Skip to content

Docker images CI

Docker images CI #6

Workflow file for this run

name: Docker images
on:
workflow_dispatch:
inputs:
base_image_tags:
description: |
List of image tags of the mcdreforged/mcdreforged image for the workflow to build as the base images, separated with ",".
For example: "1.2.3,1.2.3-slim,1.2.3-py3.11,1.2.3-py3.11-slim"
type: string
required: true
jobs:
build_matrix:
name: Build matrix from input
runs-on: ubuntu-latest
steps:
- name: Build matrix
id: matrix
uses: actions/github-script@v7
with:
script: |
let matrix = {'include': []}
let summary = core.summary.addHeading('Input tags').addEOL()
let tags = process.env.BASE_IMAGE_TAGS.split(',')
tags.filter(tag => tag !== '').forEach(tag => {
matrix.include.push({'base_image_tag': tag})
summary.addRaw(`- \`${tag}\``)
})
console.log(`matrix: ${JSON.stringify(matrix, null, 2)}`)
core.setOutput('matrix', JSON.stringify(matrix))
summary.write()
env:
BASE_IMAGE_TAGS: ${{ inputs.base_image_tags }}
outputs:
matrix: ${{ fromJson(steps.matrix.outputs.matrix) }}
images:
needs: build_matrix
strategy:
matrix: ${{ fromJson(needs.build_matrix.outputs.matrix) }}
uses: ./.github/workflows/image_derivatives.yml
secrets: inherit
with:
source_tag: ${{ matrix.base_image_tag }}