-
Notifications
You must be signed in to change notification settings - Fork 209
63 lines (63 loc) · 2.13 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
# 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@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: image=moby/buildkit:v0.11.6
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
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@v3
with:
username: "${{ env.DOCKER_HUB_USERNAME }}"
password: "${{ secrets.DOCKER_HUB_TOKEN }}"
- name: Build and push container
uses: docker/build-push-action@v5
with:
context: compiler/base/
file: compiler/base/Dockerfile
build-args: channel=${{ matrix.channel }}
push: true
tags: "${{ env.IMAGE_NAME }}:${{ github.run_id }}"
cache-from: type=gha,scope=${{ matrix.channel }}
cache-to: type=gha,scope=${{ matrix.channel }},mode=max
- 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 }}