Skip to content

Commit

Permalink
Add matrix setup and use build versions from JSON
Browse files Browse the repository at this point in the history
file
  • Loading branch information
rwaffen committed Nov 9, 2023
1 parent c45458e commit 5fb0114
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,34 @@ on:
name: Build 🛢️ container

jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
echo "::set-output name=matrix::$(cat build_versions.json | jq '. | tostring')"
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 and publish a container
- 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=8.2.0
PUPPET_RELEASE=8
PUPPET_VERSION=${{ matrix.release }}
PUPPET_RELEASE=${{ matrix.version }}
# buildfile: Dockerfile.something # Default: Dockerfile
# publish: 'false' # Default: true
# tags: |
Expand Down
14 changes: 9 additions & 5 deletions build_versions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"release7": [
"7.13.0"
],
"release8": [
"8.2.3"
"include": [
{
"release": 7,
"version": "7.13.0"
},
{
"release": 8,
"version": "8.2.1"
}
]
}

0 comments on commit 5fb0114

Please sign in to comment.