-
Notifications
You must be signed in to change notification settings - Fork 179
147 lines (133 loc) · 4.77 KB
/
buildx-images.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: buildx-images
on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "cmd/images/**"
- ".github/workflows/image-builder.yml"
push:
branches:
- main
paths:
- "cmd/images/**"
- ".github/workflows/image-builder.yml"
workflow_dispatch: {}
jobs:
# Build the base Alpine image
build-alpine:
uses: ./.github/workflows/image-builder.yml
with:
name: alpine
dockerfile: cmd/images/alpine/Dockerfile
context: .
unpack-alpine:
runs-on: ubuntu-latest
needs: build-alpine
outputs:
clean_image: ${{ steps.unpack-alpine.outputs.clean_image }}
steps:
- name: Unpack image output to output variable
id: unpack-alpine
run: |
IMAGE="${{ needs.build-alpine.outputs.images }}"
CLEAN_IMAGE=$(echo "$IMAGE" | sed 's/[][]//g')
echo "clean_image=$CLEAN_IMAGE" >> $GITHUB_OUTPUT
# Build alpine/git image that depends on build-alpine
build-alpine-git:
needs: [build-alpine, unpack-alpine]
uses: ./.github/workflows/image-builder.yml
with:
name: alpine-git
dockerfile: cmd/images/alpine/git/Dockerfile
context: .
build-args: BASE_ALPINE_IMAGE=${{ needs.unpack-alpine.outputs.clean_image }}
# Build alpine/git/gke-aws-auth image that depends on build-alpine-git
build-alpine-git-gke-aws-auth:
needs: [build-alpine, unpack-alpine]
uses: ./.github/workflows/image-builder.yml
with:
name: alpine-git-gke-aws-auth
dockerfile: cmd/images/alpine/git/gke-aws-auth/Dockerfile
context: .
build-args: BASE_ALPINE_IMAGE=${{ needs.unpack-alpine.outputs.clean_image }}
# Build the base buildpack image
build-buildpack:
uses: ./.github/workflows/image-builder.yml
with:
name: buildpack
dockerfile: cmd/images/buildpack/Dockerfile
context: .
unpack-buildpack:
runs-on: ubuntu-latest
needs: build-buildpack
outputs:
clean_image: ${{ steps.unpack-buildpack.outputs.clean_image }}
steps:
- name: Unpack image output to output variable
id: unpack-buildpack
run: |
IMAGE="${{ needs.build-buildpack.outputs.images }}"
CLEAN_IMAGE=$(echo "$IMAGE" | sed 's/[][]//g')
echo "clean_image=$CLEAN_IMAGE" >> $GITHUB_OUTPUT
# Build buildpack/go image that depends on build-buildpack
build-buildpack-go:
needs: [build-buildpack, unpack-buildpack]
uses: ./.github/workflows/image-builder.yml
with:
name: buildpack-go
dockerfile: cmd/images/buildpack/go/Dockerfile
context: .
build-args: BASE_BUILDPACK_IMAGE=${{ needs.unpack-buildpack.outputs.clean_image }}
# Build unified-agent base image
build-unified-agent:
uses: ./.github/workflows/image-builder.yml
with:
name: unified-agent
dockerfile: cmd/images/unified-agent/Dockerfile
context: .
unpack-unified-agent:
runs-on: ubuntu-latest
needs: build-unified-agent
outputs:
clean_image: ${{ steps.unpack-unified-agent.outputs.clean_image }}
steps:
- name: Unpack image output to output variable
id: unpack-unified-agent
run: |
IMAGE="${{ needs.build-unified-agent.outputs.images }}"
CLEAN_IMAGE=$(echo "$IMAGE" | sed 's/[][]//g')
echo "clean_image=$CLEAN_IMAGE" >> $GITHUB_OUTPUT
# Build unified-agent/go image that depends on build-unified-agent
build-unified-agent-go:
needs: [build-unified-agent, unpack-unified-agent]
uses: ./.github/workflows/image-builder.yml
with:
name: unified-agent-go
dockerfile: cmd/images/unified-agent/go/Dockerfile
context: .
build-args: BASE_UNIFIED_AGENT_IMAGE=${{ needs.unpack-unified-agent.outputs.clean_image }}
# Build unified-agent/nodejs image that depends on build-unified-agent
build-unified-agent-nodejs:
needs: [build-unified-agent, unpack-unified-agent]
uses: ./.github/workflows/image-builder.yml
with:
name: unified-agent-nodejs
dockerfile: cmd/images/unified-agent/nodejs/Dockerfile
context: .
build-args: BASE_UNIFIED_AGENT_IMAGE=${{ needs.unpack-unified-agent.outputs.clean_image }}
# Build unified-agent/python image that depends on build-unified-agent
build-unified-agent-python:
needs: [build-unified-agent, unpack-unified-agent]
uses: ./.github/workflows/image-builder.yml
with:
name: unified-agent-python
dockerfile: cmd/images/unified-agent/python/Dockerfile
context: .
build-args: BASE_UNIFIED_AGENT_IMAGE=${{ needs.unpack-unified-agent.outputs.clean_image }}
# Build e2e-gcloud image
build-e2e-gcloud:
uses: ./.github/workflows/image-builder.yml
with:
name: e2e-gcloud
dockerfile: cmd/images/e2e-gcloud/Dockerfile
context: .