-
-
Notifications
You must be signed in to change notification settings - Fork 1
164 lines (147 loc) · 7.01 KB
/
build_container.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
---
name: Build and publish a 🛢️ container
on:
push:
branches:
- 'main'
tags:
- '*'
workflow_dispatch:
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Source checkout
uses: actions/checkout@v4
- id: set-matrix
run: echo "matrix=$(jq -c . build_versions.json)" >> $GITHUB_OUTPUT
build-X86-container:
runs-on: macarne
permissions:
contents: read
packages: write
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
steps:
- name: Build Vox Pupuli Test Box r${{ matrix.puppet_release }}
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
registry_password: ${{ secrets.GITHUB_TOKEN }}
build_args: |
BASE_IMAGE=${{ matrix.base_image }}
RUBYGEM_PUPPET=${{ matrix.rubygem_puppet }}
RUBYGEM_FACTER=${{ matrix.rubygem_facter }}
RUBYGEM_VOXPUPULI_TEST=${{ matrix.rubygem_voxpupuli_test }}
RUBYGEM_VOXPUPULI_ACCEPTANCE=${{ matrix.rubygem_voxpupuli_acceptance }}
RUBYGEM_VOXPUPULI_RELEASE=${{ matrix.rubygem_voxpupuli_release }}
RUBYGEM_PUPPET_METADATA=${{ matrix.rubygem_puppet_metadata }}
RUBYGEM_MODULESYNC=${{ matrix.rubygem_modulesync }}
RUBYGEM_RUBOCOP_PERFORMANCE=${{ matrix.rubygem_rubocop_performance }}
RUBYGEM_BUNDLER=${{ matrix.rubygem_bundler }}
APK_JQ=${{ matrix.apk_jq }}
APK_YAMLLINT=${{ matrix.apk_yamllint }}
APK_GIT=${{ matrix.apk_git }}
APK_CURL=${{ matrix.apk_curl }}
build_arch: linux/amd64
docker_username: voxpupulibot
docker_password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }}
tags: |
docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86
ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86
build-ARM-container:
runs-on: hetzner-arm
permissions:
contents: read
packages: write
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
steps:
- name: Build Vox Pupuli Test Box r${{ matrix.puppet_release }}
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
registry_password: ${{ secrets.GITHUB_TOKEN }}
build_args: |
BASE_IMAGE=${{ matrix.base_image }}
RUBYGEM_PUPPET=${{ matrix.rubygem_puppet }}
RUBYGEM_FACTER=${{ matrix.facter_version }}
RUBYGEM_VOXPUPULI_TEST=${{ matrix.rubygem_voxpupuli_test }}
RUBYGEM_VOXPUPULI_ACCEPTANCE=${{ matrix.rubygem_voxpupuli_acceptance }}
RUBYGEM_VOXPUPULI_RELEASE=${{ matrix.rubygem_voxpupuli_release }}
RUBYGEM_PUPPET_METADATA=${{ matrix.rubygem_puppet_metadata }}
RUBYGEM_MODULESYNC=${{ matrix.rubygem_modulesync }}
RUBYGEM_RUBOCOP_PERFORMANCE=${{ matrix.rubygem_rubocop_performance }}
RUBYGEM_BUNDLER=${{ matrix.rubygem_bundler }}
APK_JQ=${{ matrix.apk_jq }}
APK_YAMLLINT=${{ matrix.apk_yamllint }}
APK_GIT=${{ matrix.apk_git }}
APK_CURL=${{ matrix.apk_curl }}
build_arch: linux/arm64
docker_username: voxpupulibot
docker_password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }}
tags: |
docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64
ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64
create-multiarch-manifests:
runs-on: ubuntu-latest
needs:
- setup-matrix
- build-X86-container
- build-ARM-container
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
steps:
- name: Log in to the ghcr.io registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the docker.io registry
uses: docker/login-action@v3
with:
registry: docker.io
username: voxpupulibot
password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }}
- name: Create multiarch manifests
run: |
docker buildx imagetools create -t ghcr.io/voxpupuli/voxbox:${{ matrix.rubygem_puppet }}-${{ github.ref_name }} \
ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \
ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86
docker buildx imagetools create -t ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.ref_name }} \
ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \
ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86
docker buildx imagetools create -t ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }} \
ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \
ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86
docker buildx imagetools create -t ghcr.io/voxpupuli/voxbox:latest \
ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \
ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86
docker buildx imagetools create -t docker.io/voxpupuli/voxbox:${{ matrix.rubygem_puppet }}-${{ github.ref_name }} \
docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \
docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86
docker buildx imagetools create -t docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.ref_name }} \
docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \
docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86
docker buildx imagetools create -t docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }} \
docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \
docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86
docker buildx imagetools create -t docker.io/voxpupuli/voxbox:latest \
docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \
docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86
update-dockerhub-description:
runs-on: ubuntu-latest
needs:
- create-multiarch-manifests
steps:
- name: Source checkout
uses: actions/checkout@v4
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: voxpupulibot
password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }}
repository: voxpupuli/voxbox