-
Notifications
You must be signed in to change notification settings - Fork 2
212 lines (193 loc) · 8.06 KB
/
debian.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Debian
on:
workflow_dispatch:
push:
branches:
- master
schedule:
- cron: '0 0 * * *'
env:
DEBIAN_FRONTEND: noninteractive
TEMPORARY_DIRECTORY: /home/runner/work/_temp
jobs:
preparation:
name: Preparation
runs-on: ubuntu-latest
steps:
- name: Create environment
run: |
echo "export DOCKER_TAG=\"${GITHUB_SHA}-$(date +'%Y%m%d-%H%M%S')\"" >> ./vars
- name: Persist environment
uses: actions/upload-artifact@v1
with:
name: environment
path: ./vars
amd64:
name: Process amd64
runs-on: ubuntu-latest
needs: [preparation]
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Fetch environment
uses: actions/download-artifact@v1
with:
name: environment
- name: Configure system
run: |
# update packages & install requirements
sudo apt-get -qy update
sudo apt-get -qy install moreutils
# enable Dockers experimental features
if [[ -z "${DOCKER_CONFIG}" ]]; then
export DOCKER_CONFIG="${TEMPORARY_DIRECTORY}/docker.$(date +%s)"
mkdir -p ${DOCKER_CONFIG}
touch ${DOCKER_CONFIG}/config.json
fi
sudo sh -c "jq -s 'add' ${DOCKER_CONFIG}/config.json ./.docker/config.json | sponge ${DOCKER_CONFIG}/config.json"
sudo sh -c "jq . ./.docker/daemon.json | sponge /etc/docker/daemon.json"
sudo service docker restart
- name: Build image
run: |
source ./environment/vars
docker build --compress --no-cache --force-rm --squash -t qoopido/easyepg.minimal:${DOCKER_TAG}-amd64 -f Dockerfile.amd64 .
docker save qoopido/easyepg.minimal:${DOCKER_TAG}-amd64 > ./amd64
- name: Persist artifact
uses: actions/upload-artifact@v1
with:
name: images
path: ./amd64
arm32v7:
name: Process arm32v7
runs-on: ubuntu-latest
needs: [preparation]
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Fetch environment
uses: actions/download-artifact@v1
with:
name: environment
- name: Configure system
run: |
# update packages & install requirements
sudo apt-get -qy update
sudo apt-get -qy install qemu-user-static binfmt-support moreutils
# copy qemu for use via Dockerfile
cp /usr/bin/qemu-arm-static ./root
# enable Dockers experimental features
if [[ -z "${DOCKER_CONFIG}" ]]; then
export DOCKER_CONFIG="${TEMPORARY_DIRECTORY}/docker.$(date +%s)"
mkdir -p ${DOCKER_CONFIG}
touch ${DOCKER_CONFIG}/config.json
fi
sudo sh -c "jq -s 'add' ${DOCKER_CONFIG}/config.json ./.docker/config.json | sponge ${DOCKER_CONFIG}/config.json"
sudo sh -c "jq . ./.docker/daemon.json | sponge /etc/docker/daemon.json"
sudo service docker restart
- name: Build image
run: |
source ./environment/vars
docker build --compress --no-cache --force-rm --squash -t qoopido/easyepg.minimal:${DOCKER_TAG}-arm32v7 -f Dockerfile.arm32v7 .
docker save qoopido/easyepg.minimal:${DOCKER_TAG}-arm32v7 > ./arm32v7
- name: Persist artifact
uses: actions/upload-artifact@v1
with:
name: images
path: ./arm32v7
arm64v8:
name: Process arm64v8
runs-on: ubuntu-latest
needs: [preparation]
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Fetch environment
uses: actions/download-artifact@v1
with:
name: environment
- name: Configure system
run: |
# update packages & install requirements
sudo apt-get -qy update
sudo apt-get -qy install qemu-user-static binfmt-support moreutils
# copy qemu for use via Dockerfile
cp /usr/bin/qemu-aarch64-static ./root
# enable Dockers experimental features
if [[ -z "${DOCKER_CONFIG}" ]]; then
export DOCKER_CONFIG="${TEMPORARY_DIRECTORY}/docker.$(date +%s)"
mkdir -p ${DOCKER_CONFIG}
touch ${DOCKER_CONFIG}/config.json
fi
sudo sh -c "jq -s 'add' ${DOCKER_CONFIG}/config.json ./.docker/config.json | sponge ${DOCKER_CONFIG}/config.json"
sudo sh -c "jq . ./.docker/daemon.json | sponge /etc/docker/daemon.json"
sudo service docker restart
- name: Build image
run: |
source ./environment/vars
docker build --compress --no-cache --force-rm --squash -t qoopido/easyepg.minimal:${DOCKER_TAG}-arm64v8 -f Dockerfile.arm64v8 .
docker save qoopido/easyepg.minimal:${DOCKER_TAG}-arm64v8 > ./arm64v8
- name: Persist artifact
uses: actions/upload-artifact@v1
with:
name: images
path: ./arm64v8
publish:
name: Process multi-arch
runs-on: ubuntu-latest
needs: [preparation, amd64, arm32v7, arm64v8]
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Fetch environment
uses: actions/download-artifact@v1
with:
name: environment
- name: Fetch artifacts
uses: actions/download-artifact@v1
with:
name: images
- name: Authenticate registry
uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Configure system
run: |
# update packages & install requirements
sudo apt-get -qy update
sudo apt-get -qy install moreutils
# enable Dockers experimental features
if [[ -z "${DOCKER_CONFIG}" ]]; then
export DOCKER_CONFIG="${TEMPORARY_DIRECTORY}/docker.$(date +%s)"
mkdir -p ${DOCKER_CONFIG}
touch ${DOCKER_CONFIG}/config.json
fi
sudo sh -c "jq -s 'add' ${DOCKER_CONFIG}/config.json ./.docker/config.json | sponge ${DOCKER_CONFIG}/config.json"
sudo sh -c "jq . ./.docker/daemon.json | sponge /etc/docker/daemon.json"
sudo service docker restart
- name: Import artifacts
run: |
docker load --input ./images/amd64
docker load --input ./images/arm32v7
docker load --input ./images/arm64v8
- name: Push version to registry
run: |
source ./environment/vars
for ARCH in amd64 arm32v7 arm64v8; do
docker push qoopido/easyepg.minimal:${DOCKER_TAG}-${ARCH}
done
docker manifest create qoopido/easyepg.minimal:${DOCKER_TAG} qoopido/easyepg.minimal:${DOCKER_TAG}-amd64 qoopido/easyepg.minimal:${DOCKER_TAG}-arm32v7 qoopido/easyepg.minimal:${DOCKER_TAG}-arm64v8
docker manifest annotate qoopido/easyepg.minimal:${DOCKER_TAG} qoopido/easyepg.minimal:${DOCKER_TAG}-arm32v7 --os linux --arch arm
docker manifest annotate qoopido/easyepg.minimal:${DOCKER_TAG} qoopido/easyepg.minimal:${DOCKER_TAG}-arm64v8 --os linux --arch arm64 --variant armv8
docker manifest push qoopido/easyepg.minimal:${DOCKER_TAG} --purge
- name: Push latest to registry
run: |
source ./environment/vars
for ARCH in amd64 arm32v7 arm64v8; do
docker tag qoopido/easyepg.minimal:${DOCKER_TAG}-${ARCH} qoopido/easyepg.minimal:latest-${ARCH}
docker push qoopido/easyepg.minimal:latest-${ARCH}
done
docker manifest create qoopido/easyepg.minimal:latest qoopido/easyepg.minimal:latest-amd64 qoopido/easyepg.minimal:latest-arm32v7 qoopido/easyepg.minimal:latest-arm64v8
docker manifest annotate qoopido/easyepg.minimal:latest qoopido/easyepg.minimal:latest-arm32v7 --os linux --arch arm
docker manifest annotate qoopido/easyepg.minimal:latest qoopido/easyepg.minimal:latest-arm64v8 --os linux --arch arm64 --variant armv8
docker manifest push qoopido/easyepg.minimal:latest --purge