-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (52 loc) · 1.4 KB
/
docker.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
49
50
51
52
53
54
55
56
57
58
59
---
name: Docker
on:
workflow_dispatch:
pull_request:
paths-ignore:
- "docs/**"
push:
paths-ignore:
- "docs/**"
branches:
- master
- "v*.*.*"
jobs:
build:
strategy:
matrix:
os: [alpine, debian]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: amd64
- name: Set up Docker Build
uses: docker/[email protected]
# ARM build takes very long time, so we build PRs for AMD64 only
- name: Select target platform
id: select_platforms
run: |
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]] ; then
echo "build_platforms=linux/amd64" >> $GITHUB_ENV
else
echo "build_platforms=linux/amd64,linux/arm64" >> $GITHUB_ENV
fi
- name: Build Docker sample image
id: docker_build
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile-${{ matrix.os }}
build-args: |
REVISION=${{ github.ref }}
platforms: ${{ env.build_platforms }}
push: false
cache-from: |
type=gha
cache-to: |
type=gha,mode=max
- name: Show Docker image digest
run: echo ${{ steps.docker_build.outputs.digest }}