Image Builder (manual) #60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Image Builder (manual) | |
on: | |
workflow_dispatch: | |
jobs: | |
configure: | |
name: Configure | |
runs-on: ubuntu-latest | |
outputs: | |
pandoc-version: ${{ steps.config.outputs.pandoc-version }} | |
stacks: ${{ steps.config.outputs.stacks }} | |
build: ${{ steps.config.outputs.build }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.after }} | |
- name: Configure build | |
id: config | |
run: | | |
versions="'3.1.13'" | |
pandoc_versions="[${versions}]" | |
stacks="'alpine'" | |
stacks="[${stacks}]" | |
build=true | |
printf "Setting outputs:\n" | |
printf " - pandoc-versions: %s\n" "$pandoc_versions" | |
printf " - stacks: %s\n" "$stacks" | |
printf " - build: %s\n" "$build" | |
printf 'pandoc-version=%s\n' "$pandoc_versions" >> $GITHUB_OUTPUT | |
printf 'stacks=%s\n' "$stacks" >> $GITHUB_OUTPUT | |
printf 'build=%s\n' "$build" >> $GITHUB_OUTPUT | |
# Build images and store them as tar archive | |
build: | |
if: ${{ fromJSON( needs.configure.outputs.build ) }} | |
name: Build | |
runs-on: ubuntu-latest | |
needs: configure | |
strategy: | |
fail-fast: false | |
matrix: | |
stack: ${{ fromJSON( needs.configure.outputs.stacks ) }} | |
version: ${{ fromJSON( needs.configure.outputs.pandoc-version ) }} | |
env: | |
PANDOC_VERSION: ${{ matrix.version }} | |
STACK: ${{ matrix.stack }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Show config | |
run: make show-args | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build extra image | |
if: ${{ matrix.stack != 'static' }} | |
run: make extra | |
- name: Create freeze file on fail | |
if: failure() | |
run: | | |
export PANDOC_VERSION=3.1.13 | |
export CREATE_FREEZE_FILE=true | |
make alpine-freeze-file | |
- name: Publish freeze file on fail | |
if: failure() | |
uses: actions/upload-artifact@ef09cdac3e2d3e60d8ccadda691f4f1cec5035cb #v4.3.1 + 3 commits | |
with: | |
if-no-files-found: error | |
name: freeze-file | |
retention-days: 3 | |
path: ${{ github.workspace }}/alpine/freeze/pandoc-3.1.13.project.freeze | |
#- name: Test extra image | |
# if: ${{ matrix.stack != 'static' }} | |
# run: make test-extra | |
#- name: Publish test output | |
# uses: actions/upload-artifact@ef09cdac3e2d3e60d8ccadda691f4f1cec5035cb #v4.3.1 + 3 commits | |
# with: | |
# if-no-files-found: error | |
# name: tests | |
# retention-days: 3 | |
# path: ${{ github.workspace }}/alpine/freeze/pandoc-3.1.13.project.freeze | |
- name: Log into ghcr.io | |
if: > | |
github.event_name != 'pull_request' && | |
github.repository == 'innofactororg/pandoc-dockerfiles' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push | |
if: > | |
github.event_name != 'pull_request' && | |
github.repository == 'innofactororg/pandoc-dockerfiles' | |
run: | | |
make push-extra |