Build Crystal Containers #905
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
name: Build Crystal Containers | |
on: | |
push: | |
paths: | |
- .github/workflows/build-crystal-containers.yml | |
- Dockerfile.crystal | |
workflow_dispatch: | |
schedule: | |
- cron: '30 1 * * *' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
# based on https://github.com/84codes/crystal-container-images | |
crystal: | |
# stable release version | |
- version: 1.14.0 | |
shards: 0.18.0 | |
alpine: '3.20' | |
libgc: 8.2.6 | |
llvm: 18 | |
tag: latest | |
# release candidate, builds should target compatibility | |
- version: 1.14.0 | |
shards: 0.18.0 | |
alpine: '3.20' | |
libgc: 8.2.6 | |
llvm: 18 | |
tag: unstable | |
# latest version with unknown side effects | |
- version: 1.14.0 | |
shards: 0.18.0 | |
alpine: '3.20' | |
libgc: 8.2.6 | |
llvm: 18 | |
tag: experimental | |
runs-on: ubuntu-latest | |
name: Build generic crystal image | |
steps: | |
- | |
name: Checkout local actions and scripts | |
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 DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build image | |
id: build | |
uses: docker/build-push-action@v4 | |
with: | |
file: Dockerfile.crystal | |
build-args: | | |
crystal_version=${{ matrix.crystal.version }} | |
shards_version=${{ matrix.crystal.shards }} | |
alpine_version=${{ matrix.crystal.alpine }} | |
llvm_version=${{ matrix.crystal.llvm }} | |
gc_version=${{ matrix.crystal.libgc }} | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
cache-from: type=gha,scope=place-crystal | |
cache-to: type=gha,scope=place-crystal,mode=max | |
tags: placeos/crystal:${{ matrix.crystal.tag }} | |
labels: | | |
org.opencontainers.image.url=https://github.com/PlaceOS/.github | |
org.opencontainers.image.vendor=Place Technology Limited | |
org.opencontainers.image.title=PlaceOS Crystal Compiler Build |