Skip to content

Docker Build

Docker Build #171

Workflow file for this run

name: Docker Build
on:
workflow_dispatch:
schedule:
- cron: 0 20 * * *
permissions:
contents: read
packages: write
jobs:
set-up-matrix:
name: Set up matrix
runs-on: ubuntu-latest
outputs:
variants: ${{ steps.fetch-variants.outputs.variants }}
json: ${{ steps.fetch-json.outputs.json }}
steps:
- uses: actions/checkout@v4
- id: fetch-variants
run: echo "variants=$(./variants.rb)" >> "$GITHUB_OUTPUT"
- id: fetch-json
run: echo "json=$(./nightly-versions.rb)" >> "$GITHUB_OUTPUT"
build:
needs: set-up-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
variant: ${{ fromJson(needs.set-up-matrix.outputs.variants) }}
name: ${{ matrix.variant }}
steps:
- uses: actions/checkout@v4
- run: echo '${{ needs.set-up-matrix.outputs.json }}' > versions.json
- run: echo date=$(jq -r .master.date versions.json) >> $GITHUB_ENV
- run: ./apply-templates.sh
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Build and push
uses: docker/build-push-action@v5
env:
tag1: ghcr.io/docker-ruby-nightly/ruby:${{ matrix.variant }}-nightly-${{ env.date }}
tag2: ghcr.io/docker-ruby-nightly/ruby:${{ matrix.variant }}-nightly
with:
context: ./master/${{ matrix.variant }}
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/386,linux/ppc64le,linux/s390x
tags: ${{ env.tag1 }},${{ env.tag2 }}