-
Notifications
You must be signed in to change notification settings - Fork 148
48 lines (40 loc) · 1.41 KB
/
docker_check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
# (part of build system config in pyproject.toml) can deduce the package version.
# See: https://github.com/marketplace/actions/build-and-push-docker-images#path-context
- name: Checkout
uses: actions/checkout@v3
- 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