-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a GitHub Action CI check to ensure Dockerfile changes actually wo…
…rk (#248)
- Loading branch information
1 parent
e96b9bb
commit 5f1c964
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# GitHub actions workflow which builds the docker images. | ||
# This is useful as it will run in PRs that change the Dockerfile, and can be | ||
# an early source of warnings that the Dockerfile isn't right. | ||
# This check also triggers when this file itself is modified. | ||
|
||
name: Check Docker image can be built successfully | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'docker/Dockerfile' | ||
- '.github/workflows/docker_check.yml' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
id: qemu | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: arm64 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Inspect builder | ||
run: docker buildx inspect | ||
|
||
# we explicitly check out the repository (and use `context: .` in buildx) | ||
# because we need to preserve the git metadata so that setuptools_scm | ||
# (as part of Sygnal's setup.py) can deduce the package version. | ||
# See: https://github.com/marketplace/actions/build-and-push-docker-images#path-context | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build all platforms | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: false | ||
labels: "gitsha1=${{ github.sha }}" | ||
file: "docker/Dockerfile" | ||
platforms: linux/amd64,linux/arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CI now checks that the Docker image still builds after the Dockerfile is modified. |