-
Notifications
You must be signed in to change notification settings - Fork 57
73 lines (62 loc) · 2.17 KB
/
Copy pathbuild-image.yml
File metadata and controls
73 lines (62 loc) · 2.17 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
name: Build Operator Image
on:
pull_request_target:
types: [closed]
permissions:
actions: write
contents: read
env:
IMG: quay.io/ogx-ai/ogx-k8s-operator:latest
jobs:
build-arch:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
runner: ubuntu-24.04
platform: linux/amd64
- arch: arm64
runner: ubuntu-24.04-arm
platform: linux/arm64
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5
- name: Login to Quay.io
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
registry: quay.io
username: ${{ secrets.APP_QUAY_USERNAME }}
password: ${{ secrets.APP_QUAY_TOKEN }}
- name: Build and push single-arch image
run: |
make image-build-push-single \
CONTAINER_TOOL=docker \
PLATFORM=${{ matrix.platform }} \
IMG=${{ env.IMG }}-${{ matrix.arch }}
create-manifest:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
needs: build-arch
runs-on: ubuntu-24.04
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5
- name: Login to Quay.io
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
registry: quay.io
username: ${{ secrets.APP_QUAY_USERNAME }}
password: ${{ secrets.APP_QUAY_TOKEN }}
- name: Create and push multi-arch manifest
run: |
docker buildx imagetools create -t ${{ env.IMG }} \
${{ env.IMG }}-amd64 \
${{ env.IMG }}-arm64