From 94b7286b5a084e81438a458dc71d9c1c829c5b19 Mon Sep 17 00:00:00 2001 From: Cornelius Roemer Date: Mon, 13 May 2024 02:47:00 +0200 Subject: [PATCH] fix(ci): use head sha not pull request merge sha --- .github/workflows/backend-image.yml | 3 ++- .github/workflows/config-preprocessor-image.yml | 3 ++- .github/workflows/e2e-k3d.yml | 7 +++---- .github/workflows/ingest-image.yml | 3 ++- .github/workflows/keycloakify-image.yml | 3 ++- .github/workflows/preprocessing-dummy-image.yml | 3 ++- .github/workflows/preprocessing-nextclade-image.yml | 3 ++- .github/workflows/website-image.yml | 3 ++- 8 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/backend-image.yml b/.github/workflows/backend-image.yml index e4b2b87bb1..99220a7300 100644 --- a/.github/workflows/backend-image.yml +++ b/.github/workflows/backend-image.yml @@ -24,6 +24,7 @@ env: DOCKER_IMAGE_NAME: ghcr.io/loculus-project/backend BRANCH_NAME: ${{ github.head_ref || github.ref_name }} BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }} + sha: ${{ github.head_ref || github.sha }} concurrency: group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-backend @@ -58,7 +59,7 @@ jobs: type=raw,value=${{ env.DIR_HASH }} type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} type=ref,event=branch - type=sha,prefix=commit- + type=raw,prefix=commit-${{ env.sha }} type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 diff --git a/.github/workflows/config-preprocessor-image.yml b/.github/workflows/config-preprocessor-image.yml index 3f0f6509b7..a82de75af0 100644 --- a/.github/workflows/config-preprocessor-image.yml +++ b/.github/workflows/config-preprocessor-image.yml @@ -24,6 +24,7 @@ env: DOCKER_IMAGE_NAME: ghcr.io/loculus-project/config-processor BRANCH_NAME: ${{ github.head_ref || github.ref_name }} BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }} + sha: ${{ github.head_ref || github.sha }} defaults: run: @@ -60,7 +61,7 @@ jobs: tags: | type=ref,event=branch type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} - type=sha,prefix=commit- + type=raw,value=commit-${{ env.sha }} type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }} - name: Build and push image uses: docker/build-push-action@v5 diff --git a/.github/workflows/e2e-k3d.yml b/.github/workflows/e2e-k3d.yml index 382399f2df..3ad89c2c8b 100644 --- a/.github/workflows/e2e-k3d.yml +++ b/.github/workflows/e2e-k3d.yml @@ -38,6 +38,7 @@ jobs: env: ALL_BROWSERS: ${{ github.ref == 'refs/heads/main' || github.event.inputs.all_browsers && 'true' || 'false' }} + sha: ${{ github.head_ref || github.sha }} steps: - name: Collect Workflow Telemetry @@ -59,7 +60,7 @@ jobs: - name: Template with helm uses: WyriHaximus/github-action-helm3@v4 with: - exec: ./deploy.py --verbose helm --branch ${{ github.ref_name }} --sha ${{ github.sha }} --for-e2e --template > /tmp/helm_template.yaml + exec: ./deploy.py --verbose helm --branch ${{ github.ref_name }} --sha ${{ env.sha }} --for-e2e --template > /tmp/helm_template.yaml - name: Upload default helm template uses: actions/upload-artifact@v4 @@ -67,10 +68,8 @@ jobs: name: helm-template path: /tmp/helm_template.yaml - name: Deploy with helm - env: - SHA_ARG: --sha ${{ github.sha }} run: | - ./deploy.py --verbose helm --branch ${{ github.ref_name }} ${{ github.event_name != 'workflow_dispatch' && env.SHA_ARG || '' }} --for-e2e + ./deploy.py --verbose helm --branch ${{ github.ref_name }} --sha ${{ env.sha }} --for-e2e - uses: actions/setup-node@v4 with: diff --git a/.github/workflows/ingest-image.yml b/.github/workflows/ingest-image.yml index fdef07b9f4..01ddddbe80 100644 --- a/.github/workflows/ingest-image.yml +++ b/.github/workflows/ingest-image.yml @@ -23,6 +23,7 @@ env: DOCKER_IMAGE_NAME: ghcr.io/loculus-project/ingest BRANCH_NAME: ${{ github.head_ref || github.ref_name }} BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }} + sha: ${{ github.head_ref || github.sha }} concurrency: group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-ingest-${{github.event.inputs.build_arm}} @@ -55,7 +56,7 @@ jobs: type=raw,value=${{ env.DIR_HASH }} type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} type=ref,event=branch - type=sha,prefix=commit- + type=raw,value=commit-${{ env.sha }} type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }} - name: Login to GitHub Container Registry diff --git a/.github/workflows/keycloakify-image.yml b/.github/workflows/keycloakify-image.yml index 749f877324..95e21b040d 100644 --- a/.github/workflows/keycloakify-image.yml +++ b/.github/workflows/keycloakify-image.yml @@ -23,6 +23,7 @@ env: DOCKER_IMAGE_NAME: ghcr.io/loculus-project/keycloakify BRANCH_NAME: ${{ github.head_ref || github.ref_name }} BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }} + sha: ${{ github.head_ref || github.sha }} concurrency: group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-keycloak-buil-${{github.event.inputs.build_arm}}d @@ -59,7 +60,7 @@ jobs: type=raw,value=${{ env.DIR_HASH }} type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} type=ref,event=branch - type=sha,prefix=commit- + type=raw,value=commit-${{ env.sha }} type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }} - name: Check if image exists id: check-image diff --git a/.github/workflows/preprocessing-dummy-image.yml b/.github/workflows/preprocessing-dummy-image.yml index e9d308b8e2..f570188711 100644 --- a/.github/workflows/preprocessing-dummy-image.yml +++ b/.github/workflows/preprocessing-dummy-image.yml @@ -24,6 +24,7 @@ env: DOCKER_IMAGE_NAME: ghcr.io/loculus-project/preprocessing-dummy BRANCH_NAME: ${{ github.head_ref || github.ref_name }} BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }} + sha: ${{ github.head_ref || github.sha }} concurrency: group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-preprocessing-dumm-${{github.event.inputs.build_arm}}y @@ -55,7 +56,7 @@ jobs: type=raw,value=${{ env.DIR_HASH }} type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} type=ref,event=branch - type=sha,prefix=commit- + type=raw,value=commit-${{ env.sha }} type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }} - name: Login to GitHub Container Registry diff --git a/.github/workflows/preprocessing-nextclade-image.yml b/.github/workflows/preprocessing-nextclade-image.yml index 71afec2bc2..ceeeb4f01e 100644 --- a/.github/workflows/preprocessing-nextclade-image.yml +++ b/.github/workflows/preprocessing-nextclade-image.yml @@ -24,6 +24,7 @@ env: DOCKER_IMAGE_NAME: ghcr.io/loculus-project/preprocessing-nextclade BRANCH_NAME: ${{ github.head_ref || github.ref_name }} BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }} + sha: ${{ github.head_ref || github.sha }} concurrency: group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-preprocessing-nextclade-${{github.event.inputs.build_arm}} @@ -56,7 +57,7 @@ jobs: type=raw,value=${{ env.DIR_HASH }} type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} type=ref,event=branch - type=sha,prefix=commit- + type=raw,value=commit-${{ env.sha }} type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }} - name: Login to GitHub Container Registry diff --git a/.github/workflows/website-image.yml b/.github/workflows/website-image.yml index 6d4d48a5f6..861a7b3094 100644 --- a/.github/workflows/website-image.yml +++ b/.github/workflows/website-image.yml @@ -23,6 +23,7 @@ env: DOCKER_IMAGE_NAME: ghcr.io/loculus-project/website BRANCH_NAME: ${{ github.head_ref || github.ref_name }} BUILD_ARM: ${{ github.event.inputs.build_arm || inputs.build_arm || github.ref == 'refs/heads/main' }} + sha: ${{ github.head_ref || github.sha }} concurrency: group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-website-${{github.event.inputs.build_arm}} @@ -55,7 +56,7 @@ jobs: type=raw,value=${{ env.DIR_HASH }} type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} type=ref,event=branch - type=sha,prefix=commit- + type=raw,value=commit-${{ env.sha }} type=raw,value=${{ env.BRANCH_NAME }}-arm,enable=${{ env.BUILD_ARM }} - name: Login to GitHub Container Registry