-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.44 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 }}