From 87e267d7907abb7be151690e8582d2693fe83b70 Mon Sep 17 00:00:00 2001 From: balint Date: Sun, 5 Apr 2026 09:51:23 +0200 Subject: [PATCH] push latest on main for e2e --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d8ea6a..7abf5d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,21 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Compute frontend image tag id: image-tag - run: echo "image_tag=ghcr.io/${{ github.repository_owner }}/kemkas-frontend:${GITHUB_SHA::8}" >> $GITHUB_OUTPUT + run: | + image_repo="ghcr.io/${{ github.repository_owner }}/kemkas-frontend" + sha_tag="${image_repo}:${GITHUB_SHA::8}" + + tags="$sha_tag" + if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then + tags+=$'\n'"${image_repo}:latest" + fi + + echo "image_tag=${sha_tag}" >> "$GITHUB_OUTPUT" + { + echo "tags<> "$GITHUB_OUTPUT" - name: Build and push frontend image uses: docker/build-push-action@v5 with: @@ -67,7 +81,7 @@ jobs: cache-to: type=gha,mode=max push: true tags: | - ${{ steps.image-tag.outputs.image_tag }} + ${{ steps.image-tag.outputs.tags }} docker-e2e-build: runs-on: ubuntu-latest @@ -89,7 +103,21 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Compute e2e image tag id: image-tag - run: echo "image_tag=ghcr.io/${{ github.repository_owner }}/kemkas-e2e:${GITHUB_SHA::8}" >> $GITHUB_OUTPUT + run: | + image_repo="ghcr.io/${{ github.repository_owner }}/kemkas-e2e" + sha_tag="${image_repo}:${GITHUB_SHA::8}" + + tags="$sha_tag" + if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then + tags+=$'\n'"${image_repo}:latest" + fi + + echo "image_tag=${sha_tag}" >> "$GITHUB_OUTPUT" + { + echo "tags<> "$GITHUB_OUTPUT" - name: Build and push e2e image uses: docker/build-push-action@v5 with: @@ -99,7 +127,7 @@ jobs: cache-to: type=gha,mode=max push: true tags: | - ${{ steps.image-tag.outputs.image_tag }} + ${{ steps.image-tag.outputs.tags }} ci-e2e-docker: runs-on: ubuntu-latest