From 5c6294bcc88d58314eaf7f804e7323a312e0dcbe Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Fri, 9 Oct 2026 11:46:10 +0200 Subject: [PATCH 1/2] fix(ci): correct the GH Action matrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After merging my previous PR I have noticed that from the JS/JSON monstrosity, only the internal deployment has been picked for merging. Therefore let’s go with an explicit definition rather than depending on the JS bullshit. Fixes PACKIT-5505 Assisted-by: GPT-6-Luna medium Signed-off-by: Matej Focko --- .github/workflows/build-and-push.yml | 54 +++++++++++++++------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index cbf92c6d..dfc24760 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -12,61 +12,67 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dockerfile: [Dockerfile] - image: [dashboard] # Include only configurations for the branch that triggered the workflow. # [TODO] Switch internal to `stable` once stabilized, duh… - include: >- - ${{ fromJSON( - github.ref_name == 'main' && - '[{"branch":"main","deployment":"stg","tag":"stg latest","api":"https://stg.packit.dev/api"}, - {"branch":"main","deployment":"internal","tag":"internal","api":"https://internal.packit.dev/api"}]' - || - '[{"branch":"stable","deployment":"prod","tag":"prod","api":"https://prod.packit.dev/api"}]' - ) }} + include: + - branch: main + deployment: stg + tags: "stg latest" + dockerfile: Dockerfile + image: dashboard + + - branch: main + deployment: internal + tags: "internal" + dockerfile: Dockerfile + image: dashboard + + - branch: stable + deployment: prod + tags: "prod" + dockerfile: Dockerfile + image: dashboard steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 - - name: Extract branch name and set tag + - name: Construct image tags and get commit SHA shell: bash env: BRANCH: ${{ matrix.branch }} - TAG: ${{ matrix.tag }} - API: ${{ matrix.api }} + TAGS: ${{ matrix.tags }} run: | - branch="$BRANCH" - tag="$TAG" - api="$API" - echo "branch=${branch}" >> $GITHUB_OUTPUT - unique_tag="${branch}-${GITHUB_SHA::7}" - echo "tag=${tag} ${unique_tag}" >> $GITHUB_OUTPUT - echo "api=${api}" >> $GITHUB_OUTPUT + UNIQUE_TAG="${BRANCH}-${GITHUB_SHA::7}" + echo "tags=${TAGS} ${UNIQUE_TAG}" >> $GITHUB_OUTPUT + echo "commit_sha=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT - id: branch_tag + id: make_facts - name: Set up secret file needed for the build + if: ${{ github.ref_name == matrix.branch }} run: echo "$SENTRY_AUTH_TOKEN" > /tmp/sentry-secret env: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: Build Image + if: ${{ github.ref_name == matrix.branch }} id: build-image # https://github.com/marketplace/actions/buildah-build uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2 with: dockerfiles: ${{ matrix.dockerfile }} image: ${{ matrix.image }} - tags: ${{ steps.branch_tag.outputs.tag }} + tags: ${{ steps.make_facts.outputs.tags }} build-args: | - VITE_API_URL=${{ steps.branch_tag.outputs.api }} - VITE_GIT_SHA=${{ steps.branch_tag.outputs.commit_sha }} DEPLOYMENT=${{ matrix.deployment }} + VITE_API_URL=https://${{ matrix.deployment }}.packit.dev/api + VITE_GIT_SHA=${{ steps.make_facts.outputs.commit_sha }} extra-args: | --secret id=sentry_auth_token,src=/tmp/sentry-secret oci: true - name: Push To Quay + if: ${{ github.ref_name == matrix.branch }} # https://github.com/marketplace/actions/push-to-registry uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2 with: From a1f9f9e05094ffc2029b6b2a0092a499c3a34364 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Mon, 12 Oct 2026 08:16:30 +0200 Subject: [PATCH 2/2] fix: drop unnecessary parametrization Signed-off-by: Matej Focko --- .github/workflows/build-and-push.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index dfc24760..b91c9a71 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -18,20 +18,14 @@ jobs: - branch: main deployment: stg tags: "stg latest" - dockerfile: Dockerfile - image: dashboard - branch: main deployment: internal tags: "internal" - dockerfile: Dockerfile - image: dashboard - branch: stable deployment: prod tags: "prod" - dockerfile: Dockerfile - image: dashboard steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 @@ -60,8 +54,8 @@ jobs: # https://github.com/marketplace/actions/buildah-build uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2 with: - dockerfiles: ${{ matrix.dockerfile }} - image: ${{ matrix.image }} + dockerfiles: Dockerfile + image: dashboard tags: ${{ steps.make_facts.outputs.tags }} build-args: | DEPLOYMENT=${{ matrix.deployment }}