Refactor build_versions.json to include an array #74
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
on: | |
- push | |
name: Build 🛢️ container | |
jobs: | |
setup-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: Source checkout | |
uses: actions/checkout@v4 | |
- id: set-matrix | |
# run: echo "::set-output name=matrix::$(cat build_versions.json | jq '. | tostring')" | |
run: echo "matrix=$(cat build_versions.json | jq -c)" >> $GITHUB_OUTPUT | |
build_job: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
needs: setup-matrix | |
strategy: | |
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} | |
steps: | |
- name: Build version ${{ matrix.release }} container | |
uses: rwaffen/gha-build-and-publish-a-container@refactor_tagging | |
with: | |
# registry: docker.io # Default: ghcr.io | |
# registry_username: foobar # Default: github.repository_owner | |
registry_password: ${{ secrets.GITHUB_TOKEN }} | |
# build_arch: linux/amd64,linux/arm64 # Default: linux/amd64 | |
build_args: | | |
PUPPET_VERSION=${{ matrix.release }} | |
PUPPET_RELEASE=${{ matrix.version }} | |
# buildfile: Dockerfile.something # Default: Dockerfile | |
# publish: 'false' # Default: true | |
# tags: | | |
# ghcr.io/betadots/gha-test-repo:devlopment | |
# ghcr.io/betadots/gha-test-repo:latest |