Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Docker Nightly Builder #2387

Docker Nightly Builder

Docker Nightly Builder #2387

---
name: Docker Nightly Builder
"on":
push:
branches:
- trunk
pull_request:
branches:
- trunk
schedule:
- cron: "0 0 * * *" # build nightly!
permissions: {}
jobs:
nightly:
name: Nightly
runs-on: ubuntu-latest
strategy:
matrix:
build:
- alpine
- debian
- ubuntu
include:
- build: alpine
target_triple: x86_64-unknown-linux-musl
dockerfile: alpine/Dockerfile
docker_target_platforms: linux/amd64
tag_bare: alpine
tag_version: alpine3
- build: debian
target_triple: x86_64-unknown-linux-gnu
dockerfile: debian/bookworm/slim/Dockerfile
docker_target_platforms: linux/amd64,linux/arm64
tag_bare: slim
tag_version: slim-bookworm
- build: ubuntu
target_triple: x86_64-unknown-linux-gnu
dockerfile: ubuntu/noble/Dockerfile
docker_target_platforms: linux/amd64,linux/arm64
tag_bare: ubuntu
tag_version: ubuntu-noble
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Clone Artichoke
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
repository: artichoke/artichoke
path: artichoke
persist-credentials: false
- name: Set Artichoke latest commit
id: latest
working-directory: artichoke
run: |
echo "Artichoke git ref: $(git rev-parse HEAD)"
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Install the latest version of uv
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v6.6.0
with:
version: "latest"
enable-cache: false
- name: Set up Python
run: uv python install
- name: Set Artichoke Rust toolchain version
id: rust_toolchain
working-directory: artichoke
shell: python
run: |
import os
import tomllib
with open("rust-toolchain.toml", "rb") as f:
data = tomllib.load(f)
toolchain = data["toolchain"]["channel"]
print(f"Rust toolchain version: {toolchain}")
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
print(f"version={toolchain}", file=f)
- name: Set labels
id: labels
working-directory: artichoke
shell: python
run: |
import datetime
import os
import tomllib
with open("Cargo.toml", "rb") as f:
data = tomllib.load(f)
version = data["package"]["version"]
version = f"{version}-nightly"
print(f"Artichoke version: {version}")
current_time = datetime.datetime.now(datetime.timezone.utc)
build_timestamp = current_time.isoformat()
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
print(f"artichoke_version={version}", file=f)
print(f"build_timestamp={build_timestamp}", file=f)
- name: Generate THIRDPARTY license listing
uses: artichoke/generate_third_party@5e60601807f55fd22efcdbdfbdbc2f65d63436b1 # v1.16.0
with:
artichoke_ref: ${{ steps.latest.outputs.commit }}
target_triple: ${{ matrix.target_triple }}
output_file: ${{ github.workspace }}/THIRDPARTY
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
with:
cache-binary: false
- name: Login to DockerHub
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
if: github.ref == 'refs/heads/trunk'
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
platforms: ${{ matrix.docker_target_platforms }}
file: ${{ matrix.dockerfile }}
push: ${{ github.ref == 'refs/heads/trunk' }}
tags: |
artichokeruby/artichoke:${{ matrix.tag_bare }}-nightly
artichokeruby/artichoke:${{ matrix.tag_version }}-nightly
build-args: |
ARTICHOKE_NIGHTLY_REVISION=${{ steps.latest.outputs.commit }}
ARTICHOKE_NIGHTLY_VERSION=${{ steps.labels.outputs.artichoke_version }}
BUILD_TIMESTAMP=${{ steps.labels.outputs.build_timestamp }}
RUST_VERSION=${{ steps.rust_toolchain.outputs.version }}
- name: Build and push Docker images (Ubuntu extra tags)
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
if: matrix.build == 'ubuntu'
with:
context: .
platforms: ${{ matrix.docker_target_platforms }}
file: ${{ matrix.dockerfile }}
push: ${{ github.ref == 'refs/heads/trunk' }}
tags: |
artichokeruby/artichoke:latest
artichokeruby/artichoke:ubuntu24.04-nightly
build-args: |
ARTICHOKE_NIGHTLY_REVISION=${{ steps.latest.outputs.commit }}
ARTICHOKE_NIGHTLY_VERSION=${{ steps.labels.outputs.artichoke_version }}
BUILD_TIMESTAMP=${{ steps.labels.outputs.build_timestamp }}
RUST_VERSION=${{ steps.rust_toolchain.outputs.version }}