Skip to content

Commit

Permalink
fix(ci): use head sha not pull request merge sha
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusroemer committed May 13, 2024
1 parent 3a51e0c commit 94b7286
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/backend-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/config-preprocessor-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/e2e-k3d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -59,18 +60,16 @@ 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
with:
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:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ingest-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/keycloakify-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/preprocessing-dummy-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/preprocessing-nextclade-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/website-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 94b7286

Please sign in to comment.