-
Notifications
You must be signed in to change notification settings - Fork 207
185 lines (185 loc) · 6.33 KB
/
cron.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
# This file was generated by ci/generate and should not be modified by hand
---
name: Scheduled rebuild
'on':
workflow_dispatch:
schedule:
- cron: 7 2 * * *
env:
DOCKER_HUB_USERNAME: shepmaster
GH_CONTAINER_REGISTRY_USERNAME: shepmaster
AWS_ACCESS_KEY_ID: AKIAWESVHZ3JQAY5NM5K
jobs:
build_compiler_containers:
name: Build ${{ matrix.channel }} compiler container
runs-on: ubuntu-latest
strategy:
matrix:
channel:
- stable
- beta
- nightly
env:
IMAGE_NAME: ghcr.io/integer32llc/rust-playground-ci-rust-${{ matrix.channel }}
DOCKER_HUB_IMAGE_NAME: shepmaster/rust-${{ matrix.channel }}
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: image=moby/buildkit:v0.11.6
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: "${{ env.GH_CONTAINER_REGISTRY_USERNAME }}"
password: "${{ secrets.GH_CONTAINER_REGISTRY_TOKEN }}"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: "${{ env.DOCKER_HUB_USERNAME }}"
password: "${{ secrets.DOCKER_HUB_TOKEN }}"
- name: Build and push 'toolchain' container
env:
TAG_PREFIX: "${{ env.IMAGE_NAME }}:toolchain"
uses: docker/build-push-action@v4
with:
context: compiler/base/
file: compiler/base/Dockerfile
build-args: channel=${{ matrix.channel }}
target: toolchain
pull: true
push: true
tags: "${{ env.TAG_PREFIX }}--${{ github.run_id }}"
cache-from: |-
${{ env.TAG_PREFIX }}--${{ github.run_id }}
${{ env.TAG_PREFIX }}--latest
cache-to: type=inline
- name: Build and push 'bare-sources' container
env:
TAG_PREFIX: "${{ env.IMAGE_NAME }}:bare-sources"
uses: docker/build-push-action@v4
with:
context: compiler/base/
file: compiler/base/Dockerfile
build-args: channel=${{ matrix.channel }}
target: bare-sources
pull: true
push: true
tags: "${{ env.TAG_PREFIX }}--${{ github.run_id }}"
cache-from: |-
${{ env.TAG_PREFIX }}--${{ github.run_id }}
${{ env.TAG_PREFIX }}--latest
cache-to: type=inline
- name: Build and push 'munge' container
env:
TAG_PREFIX: "${{ env.IMAGE_NAME }}:munge"
uses: docker/build-push-action@v4
with:
context: compiler/base/
file: compiler/base/Dockerfile
build-args: channel=${{ matrix.channel }}
target: munge
pull: true
push: true
tags: "${{ env.TAG_PREFIX }}--${{ github.run_id }}"
cache-from: |-
${{ env.TAG_PREFIX }}--${{ github.run_id }}
${{ env.TAG_PREFIX }}--latest
cache-to: type=inline
- name: Build and push 'sources' container
env:
TAG_PREFIX: "${{ env.IMAGE_NAME }}:sources"
uses: docker/build-push-action@v4
with:
context: compiler/base/
file: compiler/base/Dockerfile
build-args: channel=${{ matrix.channel }}
target: sources
pull: true
push: true
tags: "${{ env.TAG_PREFIX }}--${{ github.run_id }}"
cache-from: |-
${{ env.TAG_PREFIX }}--${{ github.run_id }}
${{ env.TAG_PREFIX }}--latest
cache-to: type=inline
- name: Build and push container
uses: docker/build-push-action@v4
with:
context: compiler/base/
file: compiler/base/Dockerfile
build-args: channel=${{ matrix.channel }}
pull: true
push: true
tags: "${{ env.IMAGE_NAME }}:${{ github.run_id }}"
cache-from: |-
${{ env.IMAGE_NAME }}:${{ github.run_id }}
${{ env.IMAGE_NAME }}:latest
cache-to: type=inline
- name: Pull container
run: docker pull ${{ env.IMAGE_NAME }}:${{ github.run_id }}
- name: Rename container
run: |-
docker tag ${{ env.IMAGE_NAME }}:${{ github.run_id }} ${{ env.IMAGE_NAME }}
docker tag ${{ env.IMAGE_NAME }}:${{ github.run_id }} ${{ env.DOCKER_HUB_IMAGE_NAME }}
- name: Push container
run: |-
docker push ${{ env.IMAGE_NAME }}
docker push ${{ env.DOCKER_HUB_IMAGE_NAME }}
build_tool_containers:
name: Build ${{ matrix.tool }} tool container
runs-on: ubuntu-latest
needs: build_compiler_containers
strategy:
matrix:
tool:
- clippy
- miri
- rustfmt
env:
IMAGE_NAME: ghcr.io/integer32llc/rust-playground-ci-tool-${{ matrix.tool }}
DOCKER_HUB_IMAGE_NAME: shepmaster/${{ matrix.tool }}
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: image=moby/buildkit:v0.11.6
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: "${{ env.GH_CONTAINER_REGISTRY_USERNAME }}"
password: "${{ secrets.GH_CONTAINER_REGISTRY_TOKEN }}"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: "${{ env.DOCKER_HUB_USERNAME }}"
password: "${{ secrets.DOCKER_HUB_TOKEN }}"
- name: Build and push container
uses: docker/build-push-action@v4
with:
context: compiler/${{ matrix.tool }}/
file: compiler/${{ matrix.tool }}/Dockerfile
build-args: base_image=ghcr.io/integer32llc/rust-playground-ci-rust-nightly:sources--${{ github.run_id }}
pull: true
push: true
tags: "${{ env.IMAGE_NAME }}:${{ github.run_id }}"
cache-from: |-
${{ env.IMAGE_NAME }}:${{ github.run_id }}
${{ env.IMAGE_NAME }}:latest
cache-to: type=inline
- name: Pull container
run: docker pull ${{ env.IMAGE_NAME }}:${{ github.run_id }}
- name: Rename container
run: |-
docker tag ${{ env.IMAGE_NAME }}:${{ github.run_id }} ${{ env.IMAGE_NAME }}
docker tag ${{ env.IMAGE_NAME }}:${{ github.run_id }} ${{ env.DOCKER_HUB_IMAGE_NAME }}
- name: Push container
run: |-
docker push ${{ env.IMAGE_NAME }}
docker push ${{ env.DOCKER_HUB_IMAGE_NAME }}