-
Notifications
You must be signed in to change notification settings - Fork 40
217 lines (194 loc) · 7.89 KB
/
docker-deploy.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
213
214
215
216
217
# Copyright 2022, Proofcraft Pt Ltd
#
# SPDX-License-Identifier: BSD-2-Clause
# Build and deploy standard set of docker containers
name: Deploy
on:
push:
branches:
- master
workflow_dispatch:
schedule:
# every Thu at 17:03, i.e. once a week at not-quite a full hour
- cron: "3 17 * * 4"
jobs:
tag:
runs-on: ubuntu-latest
name: Create tag
outputs:
tag: ${{ steps.date.outputs.tag }}
steps:
- name: Get date
id: date
run: |
echo "tag=$(date '+%Y_%m_%d')" >> $GITHUB_OUTPUT
# There is unfortunately no point in parallelising the build of the different
# images, because they depend on each other. So sequential is the best we can do.
# We still split of the l4v build, because the GitHub runner otherwise runs out of
# disk space.
build-amd64:
name: Docker (AMD64)
runs-on: ubuntu-latest
needs: tag
env:
TAG: ${{ needs.tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
- name: "Build trustworthysystems/sel4"
run: |
./build.sh -v -b sel4
docker tag trustworthysystems/sel4:latest trustworthysystems/sel4:${TAG}-amd64
# the following will also build the plain camkes image:
- name: "Build trustworthysystems/camkes-cakeml-rust"
run: |
./build.sh -v -b camkes -s cakeml -s rust
docker tag trustworthysystems/camkes:latest trustworthysystems/camkes:${TAG}-amd64
docker tag trustworthysystems/camkes-cakeml-rust:latest \
trustworthysystems/camkes-cakeml-rust:${TAG}-amd64
- name: Authenticate
if: ${{ github.repository_owner == 'seL4' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: "Push trustworthysystems/sel4"
if: ${{ github.repository_owner == 'seL4' }}
run: |
docker push trustworthysystems/sel4:${TAG}-amd64
docker tag trustworthysystems/sel4:${TAG}-amd64 trustworthysystems/sel4:latest-amd64
docker push trustworthysystems/sel4:latest-amd64
- name: "Push trustworthysystems/camkes"
if: ${{ github.repository_owner == 'seL4' }}
run: |
docker push trustworthysystems/camkes:${TAG}-amd64
docker tag trustworthysystems/camkes:${TAG}-amd64 trustworthysystems/camkes:latest-amd64
docker push trustworthysystems/camkes:latest-amd64
- name: "Push trustworthysystems/camkes-cakeml-rust"
if: ${{ github.repository_owner == 'seL4' }}
run: |
docker push trustworthysystems/camkes-cakeml-rust:${TAG}-amd64
docker tag trustworthysystems/camkes-cakeml-rust:${TAG}-amd64 \
trustworthysystems/camkes-cakeml-rust:latest-amd64
docker push trustworthysystems/camkes-cakeml-rust:latest-amd64
build-arm64:
name: Docker (ARM64)
runs-on: [self-hosted, macos, ARM64]
needs: tag
env:
TAG: ${{ needs.tag.outputs.tag }}
steps:
- name: Authenticate
if: ${{ github.repository_owner == 'seL4' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: "Remove old images"
run: docker system prune -a -f
- uses: actions/checkout@v4
- name: "Build trustworthysystems/sel4"
run: |
./build.sh -vr -b sel4
docker tag trustworthysystems/sel4:latest trustworthysystems/sel4:${TAG}-arm64
# the following will also build the plain camkes image:
- name: "Build trustworthysystems/camkes-cakeml-rust"
run: |
./build.sh -vr -b camkes -s cakeml -s rust
docker tag trustworthysystems/camkes:latest trustworthysystems/camkes:${TAG}-arm64
docker tag trustworthysystems/camkes-cakeml-rust:latest \
trustworthysystems/camkes-cakeml-rust:${TAG}-arm64
- name: "Push trustworthysystems/sel4"
if: ${{ github.repository_owner == 'seL4' }}
run: |
docker push trustworthysystems/sel4:${TAG}-arm64
docker tag trustworthysystems/sel4:${TAG}-arm64 trustworthysystems/sel4:latest-arm64
docker push trustworthysystems/sel4:latest-arm64
- name: "Push trustworthysystems/camkes"
if: ${{ github.repository_owner == 'seL4' }}
run: |
docker push trustworthysystems/camkes:${TAG}-arm64
docker tag trustworthysystems/camkes:${TAG}-arm64 trustworthysystems/camkes:latest-arm64
docker push trustworthysystems/camkes:latest-arm64
- name: "Push trustworthysystems/camkes-cakeml-rust"
if: ${{ github.repository_owner == 'seL4' }}
run: |
docker push trustworthysystems/camkes-cakeml-rust:${TAG}-arm64
docker tag trustworthysystems/camkes-cakeml-rust:${TAG}-arm64 \
trustworthysystems/camkes-cakeml-rust:latest-arm64
docker push trustworthysystems/camkes-cakeml-rust:latest-arm64
build-l4v:
name: Docker (l4v, AMD64)
runs-on: ubuntu-latest
needs: [tag, build-amd64]
env:
TAG: ${{ needs.tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
- name: "Build trustworthysystems/l4v"
run: |
docker pull trustworthysystems/camkes:${TAG}-amd64
docker tag trustworthysystems/camkes:${TAG}-amd64 trustworthysystems/camkes:latest
./build.sh -v -b l4v
docker tag trustworthysystems/l4v:latest trustworthysystems/l4v:${TAG}
- name: Authenticate
if: ${{ github.repository_owner == 'seL4' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: "Push trustworthysystems/l4v"
if: ${{ github.repository_owner == 'seL4' }}
run: |
docker push trustworthysystems/l4v:${TAG}
docker tag trustworthysystems/l4v:${TAG} trustworthysystems/l4v:latest
docker push trustworthysystems/l4v:latest
multi-arch:
name: Multi-arch images
runs-on: ubuntu-latest
needs: [tag, build-amd64, build-arm64]
if: ${{ github.repository_owner == 'seL4' }}
env:
TAG: ${{ needs.tag.outputs.tag }}
steps:
- name: Authenticate
if: ${{ github.repository_owner == 'seL4' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: "Multi-arch seL4"
run: |
docker buildx imagetools create -t trustworthysystems/sel4:${TAG} \
trustworthysystems/sel4:${TAG}-arm64 \
trustworthysystems/sel4:${TAG}-amd64
docker buildx imagetools create -t trustworthysystems/sel4:latest \
trustworthysystems/sel4:${TAG}-arm64 \
trustworthysystems/sel4:${TAG}-amd64
- name: "Multi-arch CAmkES"
run: |
docker buildx imagetools create -t trustworthysystems/camkes:${TAG} \
trustworthysystems/camkes:${TAG}-arm64 \
trustworthysystems/camkes:${TAG}-amd64
docker buildx imagetools create -t trustworthysystems/camkes:latest \
trustworthysystems/camkes:${TAG}-arm64 \
trustworthysystems/camkes:${TAG}-amd64
- name: "Multi-arch CAmkES+CakeML+Rust"
run: |
docker buildx imagetools create -t trustworthysystems/camkes-cakeml-rust:${TAG} \
trustworthysystems/camkes-cakeml-rust:${TAG}-arm64 \
trustworthysystems/camkes-cakeml-rust:${TAG}-amd64
docker buildx imagetools create -t trustworthysystems/camkes-cakeml-rust:latest \
trustworthysystems/camkes-cakeml-rust:${TAG}-arm64 \
trustworthysystems/camkes-cakeml-rust:${TAG}-amd64
dispatch:
name: Dispatch
runs-on: ubuntu-latest
needs: [multi-arch]
if: ${{ github.repository_owner == 'seL4' }}
steps:
- name: Trigger ci-actions deployment
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PRIV_REPO_TOKEN }}
repository: seL4/ci-actions
event-type: deps-update