diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 231623b..988c0f2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,13 +1,6 @@ name: Image Builder on: - push: - branches: - - main - paths: - - alpine/freeze/** - - static/freeze/** - - ubuntu/freeze/** workflow_dispatch: inputs: pandoc_version: @@ -25,50 +18,11 @@ on: - static jobs: - prepare: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - - steps: - - uses: actions/checkout@v4 - - - id: set-matrix - run: | - if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then - echo "matrix={\"include\":[{\"stack\":\"${{ inputs.base_system }}\",\"version\":\"${{ inputs.pandoc_version }}\"}]}" >> $GITHUB_OUTPUT - else - CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) - MATRIX="{\"include\":[" - FIRST=true - - for STACK in alpine ubuntu static; do - if echo "$CHANGED_FILES" | grep -q "^$STACK/"; then - FREEZE_FILE=$(echo "$CHANGED_FILES" | grep "^$STACK/.*\.project\.freeze$" | head -1) - if [ -n "$FREEZE_FILE" ]; then - VERSION=$(basename "$FREEZE_FILE" | sed -E 's/pandoc-(.*)\.project\.freeze/\1/') - if [ "$FIRST" = true ]; then - FIRST=false - else - MATRIX="${MATRIX}," - fi - MATRIX="${MATRIX}{\"stack\":\"{$STACK:-alpine}\",\"version\":\"${VERSION:-main}\"}" - fi - fi - done - - MATRIX="${MATRIX}]}" - echo "matrix=$MATRIX" >> $GITHUB_OUTPUT - fi - + # Build images and store them as tar archive core: - name: minimal and core (${{ matrix.stack }}) - needs: prepare + name: minimal and core runs-on: ubuntu-latest - strategy: - matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} - fail-fast: false - + steps: - uses: actions/checkout@v4 @@ -97,58 +51,49 @@ jobs: uses: ./.github/actions/build with: image_type: minimal - base_system: ${{ matrix.stack }} - pandoc_version: ${{ matrix.version }} - dockerfile: ${{ matrix.stack }}/Dockerfile - target: ${{ matrix.stack }}-minimal + base_system: ${{ inputs.base_system }} + pandoc_version: ${{ inputs.pandoc_version }} + dockerfile: ${{ inputs.base_system }}/Dockerfile + target: ${{ inputs.base_system }}-minimal - name: core uses: ./.github/actions/build - if: ${{ matrix.stack != 'static' }} + if: ${{ inputs.base_system != 'static' }} with: image_type: core - base_system: ${{ matrix.stack }} - pandoc_version: ${{ matrix.version }} - dockerfile: ${{ matrix.stack }}/Dockerfile - target: ${{ matrix.stack }}-core + base_system: ${{ inputs.base_system }} + pandoc_version: ${{ inputs.pandoc_version }} + dockerfile: ${{ inputs.base_system }}/Dockerfile + target: ${{ inputs.base_system }}-core typst: - name: Typst (${{ matrix.stack }}) - if: ${{ matrix.stack != 'static' }} - needs: [prepare, core] - strategy: - matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} - fail-fast: false + name: Typst + if: ${{ inputs.base_system != 'static' }} + needs: core uses: ./.github/workflows/addon.yaml secrets: inherit with: addon: typst - base_system: ${{ matrix.stack }} - pandoc_version: ${{ matrix.version }} + base_system: ${{ inputs.base_system }} + pandoc_version: ${{ inputs.pandoc_version }} latex: - name: LaTeX (${{ matrix.stack }}) - if: ${{ matrix.stack != 'static' }} - needs: [prepare, core] - strategy: - matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} - fail-fast: false + name: LaTeX + if: ${{ inputs.base_system != 'static' }} + needs: core uses: ./.github/workflows/addon.yaml secrets: inherit with: addon: latex - base_system: ${{ matrix.stack }} - pandoc_version: ${{ matrix.version }} + base_system: ${{ inputs.base_system }} + pandoc_version: ${{ inputs.pandoc_version }} extra: - name: Extra (${{ matrix.stack }}) - needs: [prepare, latex] - strategy: - matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} - fail-fast: false + name: Extra + needs: latex uses: ./.github/workflows/addon.yaml secrets: inherit with: addon: extra - base_system: ${{ matrix.stack }} - pandoc_version: ${{ matrix.version }} + base_system: ${{ inputs.base_system }} + pandoc_version: ${{ inputs.pandoc_version }}