Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not build Docker images on PR #1933

Closed
wants to merge 11 commits into from
13 changes: 6 additions & 7 deletions .github/workflows/build-cloud-img.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
- main
tags:
- v*
# we will NOT push the image on pull requests, only test buildability.
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read
Expand Down Expand Up @@ -66,9 +66,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# do not login to container registry on PRs
- if: github.event_name != 'pull_request'
name: Docker login
- name: Docker login
uses: docker/login-action@v2
with:
registry: ghcr.io
Expand All @@ -82,6 +80,7 @@ jobs:
file: docker-build/Dockerfile.cloud
platforms: Linux/${{ matrix.arch }}
# do not push the image on PRs
# yes, we do not run this on PRs, but this is an additional safety net
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 4 additions & 0 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
branches:
- 'main'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
docker:
strategy:
Expand Down