Skip to content

Docker Build

Docker Build #8

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:
matrix:
variant: ${{ fromJson(needs.set-up-matrix.outputs.variants) }}
name: ${{ matrix.variant }}
steps:
- uses: actions/checkout@v4
- run: echo ${{ matrix.variant }}
- 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 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
with:
context: ./master/${{ matrix.variant }}
push: true
tags: docker-ruby-nightly/ruby:${{ matrix.variant }}-nightly-${{ env.date }}
cache-from: type=gha
cache-to: type=gha,mode=max