Skip to content

feat: properly tag different platforms #7

feat: properly tag different platforms

feat: properly tag different platforms #7

Workflow file for this run

name: ci
permissions:
packages: write
on:
pull_request:
workflow_dispatch:
push:
branches:
- master
schedule:
# See https://crontab.guru/monthly
- cron: 0 0 1 * *
jobs:
build-test-push:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pg_version:
- "16"
- "15"
- "13"
platform:
- "amd64"
- "arm64"
env:
LATEST_RELEASE: "16"
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: matrix.platform == 'arm64'
with:
platforms: arm64
- name: Get build date
id: date
run: echo "date=$(date --rfc-3339 ns)" >> $GITHUB_OUTPUT
- name: Build image
id: build
uses: redhat-actions/buildah-build@v2
with:
image: postgres-autoconf
tags: ${{ matrix.pg_version }}-alpine${{ matrix.platform != 'amd64' && '-' + matrix.platform || '' }}${{ matrix.pg_version == env.LATEST_RELEASE && ' latest' || '' }}${{ matrix.pg_version == env.LATEST_RELEASE && matrix.platform != 'amd64' && '-' + matrix.platform || '' }}

Check failure on line 50 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / ci

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yaml (Line: 50, Col: 17): Unexpected symbol: '+'. Located at position 35 within expression: matrix.platform != 'amd64' && '-' + matrix.platform || ''
context: .
platforms: linux/${{ matrix.platform }}
containerfiles: |
Dockerfile
build-args: |
BUILD_DATE=${{ steps.date.output }}
VCS_REF=${{ github.sha }}
BASE_TAG=${{ matrix.pg_version }}-alpine
- name: Push image to GHCR
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: ghcr.io/cmwedding-it
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}