-
Notifications
You must be signed in to change notification settings - Fork 11
102 lines (97 loc) · 3.61 KB
/
build.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
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
name: Build
# Controls when the workflow will run
on:
pull_request:
branches:
- 'main'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
actions: read
contents: read
id-token: write
steps:
# Get the repository's code
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
- name: Docker meta
id: daemon # you'll use this in the next step
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/azure/kube-egress-gateway-daemon
tags: |
type=semver,pattern={{raw}}
bake-target: daemon-tags
- name: Docker meta
id: controller # you'll use this in the next step
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/azure/kube-egress-gateway-controller
tags: |
type=semver,pattern={{raw}}
bake-target: controller-tags
- name: Docker meta
id: cnimanager # you'll use this in the next step
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/azure/kube-egress-gateway-cnimanager
tags: |
type=semver,pattern={{raw}}
bake-target: cnimanager-tags
- name: Docker meta
id: cniplugin # you'll use this in the next step
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/azure/kube-egress-gateway-cni
tags: |
type=semver,pattern={{raw}}
bake-target: cni-tags
- name: Docker meta
id: cniipamplugin # you'll use this in the next step
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/azure/kube-egress-gateway-cni-ipam
tags: |
type=semver,pattern={{raw}}
bake-target: cni-ipam-tags
- name: Set platform env for pr build
run: |
echo "TARGET_PLATFORMS=linux/amd64" >> $GITHUB_ENV
- name: Build and push
uses: docker/bake-action@3fc70e1131fee40a422dd8dd0ff22014ae20a1f3 # v5.11.0
env:
PLATFORMS: ${{env.TARGET_PLATFORMS}}
with:
push: false
files: |
docker/docker-bake.hcl
${{ steps.daemon.outputs.bake-file }}
${{ steps.controller.outputs.bake-file }}
${{ steps.cnimanager.outputs.bake-file }}
${{ steps.cniplugin.outputs.bake-file }}
${{ steps.cniipamplugin.outputs.bake-file }}