-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (99 loc) · 3.12 KB
/
onbuild.yaml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
name: Onbuild
on:
push:
pull_request:
concurrency:
# don't run on commits in quick succession on the same branch
group: ${{ github.ref }}
# ... except for main, where we want a full record of CI
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
build-onbuild:
name: "Build Images with ONBUILD Instructions"
runs-on: ubuntu-22.04
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Set up QEMU"
uses: docker/setup-qemu-action@v2
with:
platforms: "linux/amd64, linux/arm64"
- name: "Set up Docker Buildx"
uses: docker/setup-buildx-action@v2
with:
version: v0.10.4
install: true
- name: "Log in to GHCR"
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: false
- name: Extract Metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
# image names and tags are actually defined in the bakefile
# TODO this should done by metadata-action,
# but is currently unsupported, tracked in #220
images: "i-am-ignored"
- name: "Build and Push Images"
# cache-to is disabled below because of #218
run: |
make bake \
tag_from_git_sha="${{ github.sha }}" \
git_ref_name="${{ github.ref_name }}" \
can_push=true \
bake_args="--set=*.cache-to='type=inline'"
# workaround for missing multi-node registry cache, tracked in #218
build-onbuild-cache-multiarch:
name: "Build Multiarch Cache"
# helps to avoid concurrency issues with GHCR
needs: build-onbuild
runs-on: ubuntu-22.04
# this is just caching after all
continue-on-error: true
strategy:
fail-fast: false
# avoid more concurrency
max-parallel: 1
matrix:
arch: [
linux/arm64,
linux/amd64
]
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Set up QEMU"
uses: docker/setup-qemu-action@v2
with:
platforms: "${{ matrix.arch }}"
- name: "Set up Docker Buildx"
uses: docker/setup-buildx-action@v2
with:
version: v0.10.4
install: true
- name: "Log in to GHCR"
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: false
- name: Extract Metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
# image names and tags are actually defined in the bakefile
# TODO this should done by metadata-action,
# but is currently unsupported, tracked in #220
images: "i-am-ignored"
- name: "Build and Push Arch Image Cache"
run: |
ARCH="${{ matrix.arch }}" \
make bake-multiarch-cache \
tag_from_git_sha="${{ github.sha }}" \
git_ref_name="${{ github.ref_name }}"