Scheduled rebuild #999
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 }} |