-
Notifications
You must be signed in to change notification settings - Fork 9
94 lines (84 loc) · 2.39 KB
/
build.yml
File metadata and controls
94 lines (84 loc) · 2.39 KB
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
name: Build
on:
push:
branches:
- 'test/*'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
- 'test-[a-zA-Z0-9]+'
env:
DOCKER_META_IMAGES: |
ghcr.io/imgproxy/imgproxy-base
DOCKER_META_TAGS: |
type=semver,pattern=v{{version}}
type=ref,event=branch,enable=${{ startsWith(github.ref, 'refs/heads/test/') }}
jobs:
build:
strategy:
matrix:
build:
- arch: amd64
dockerPlatform: linux/amd64
image: linux-5.0
- arch: arm64
dockerPlatform: linux/arm64/v8
image: arm-3.0
runs-on:
- codebuild-imgproxy-${{ github.run_id }}-${{ github.run_attempt }}
- image:${{ matrix.build.image }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_META_IMAGES }}
tags: ${{ env.DOCKER_META_TAGS }}
flavor: |
latest=auto
suffix=-${{ matrix.build.arch }},onlatest=true
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.build.dockerPlatform }}
provenance: false
push: true
push_manifests:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_META_IMAGES }}
tags: ${{ env.DOCKER_META_TAGS }}
flavor: |
latest=auto
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push manifests
run: |
for tag in ${{ join(fromJSON(steps.meta.outputs.json).tags, ' ') }}
do
docker buildx imagetools create -t $tag ${tag}-amd64 ${tag}-arm64
done