Skip to content

Rust Builder

Rust Builder #356

Workflow file for this run

name: Rust Builder
on:
schedule:
# Triggers the workflow every day at 5:30 UTC:
- cron: "30 5 * * *"
push:
branches:
workflow_dispatch:
env:
registry: ghcr.io
jobs:
build-and-push-image:
runs-on: ubuntu-latest
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
toolchain_version:
- stable
- nightly
debian_suite:
- bullseye
# Do *not* execute scheduled runs for matrix.toolchain_version == 'stable'
scheduled:
- ${{ github.event_name == 'schedule' }}
exclude:
- scheduled: true
toolchain_version: stable
name: Build and push rust_builder:${{ matrix.debian_suite }}-${{ matrix.toolchain_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.registry }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.registry }}/${{ github.repository_owner }}/rust_builder
tags: |
type=raw,value=${{ matrix.toolchain_version }}-latest
type=raw,value=${{ matrix.debian_suite }}-${{ matrix.toolchain_version }}
type=schedule,pattern=${{ matrix.debian_suite }}-${{ matrix.toolchain_version }}-{{date 'YYYYMMDD'}}
- name: Push to GitHub Container Registry
uses: docker/build-push-action@v4
with:
build-args: |
TOOLCHAIN_VERSION=${{ matrix.toolchain_version }}
DEBIAN_SUITE=${{ matrix.debian_suite }}
context: ./rust_builder/
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}