Skip to content

ci: read matrix output #740

ci: read matrix output

ci: read matrix output #740

Workflow file for this run

name: Automated builds
on:
push:
paths:
- "images/**"
- ".github/workflows/*"
pull_request: # They will only build the containers, not push them to our registry
paths:
- "images/**"
- ".github/workflows/*"
types:
- opened
- edited
- ready_for_review
- review_requested
- reopened
# schedule:
# - cron: "0 0 * * *" # nightly
jobs:
base:
uses: ./.github/workflows/docker-build-and-publish.yml
with:
image_name: "base"
secrets: inherit
base-app:
needs: [base]
uses: ./.github/workflows/docker-build-and-publish.yml
strategy:
matrix:
platforms:
- name: linux/amd64
runner: "ubuntu-latest"
- name: linux/arm64
runner: "ARM64"
with:
image_name: "base-app"
base_image: "${{ needs.base.outputs.image_tag }}"
platforms: "${{ matrix.platforms.name }}"
runner: "${{ matrix.platforms.runner }}"
secrets: inherit
## Read matrix base-app outputs
read-matrix:
runs-on: ubuntu-latest
needs: [base-app]
steps:
- uses: cloudposse/github-action-matrix-outputs-read@v1
id: read
with:
matrix-step-name: base-app
- name: Convert slash-based keys to new outputs
id: convert
run: |
echo "results=$(echo '${{ steps.read.outputs.result }}' | jq -r '.image_tag.name[\"linux/amd64\"]')" >> $GITHUB_OUTPUT
echo "results_arm64=$(echo '${{ steps.read.outputs.result }}' | jq -r '.image_tag.name[\"linux/arm64\"]')" >> $GITHUB_OUTPUT
outputs:
base_app_image_amd64: ${{ steps.convert.outputs.results }}
base_app_image_arm64: ${{ steps.convert.outputs.results_arm64 }}
apps-amd64:
needs: [read-matrix]
strategy:
matrix:
image:
- xorg
- pulseaudio
- udevd
- sunshine
- retroarch
- firefox
- steam
- pegasus
- lutris
- heroic-games-launcher
fail-fast: false
uses: ./.github/workflows/docker-build-and-publish.yml
with:
image_name: "${{ matrix.image }}"
base_image: "${{ needs.base.outputs.image_tag }}"
base_app_image: "${{ needs['read-matrix'].outputs.base_app_image_amd64 }}"
secrets: inherit
apps-arm64:
needs: [read-matrix]
strategy:
matrix:
image:
- firefox
fail-fast: false
uses: ./.github/workflows/docker-build-and-publish.yml
with:
image_name: "${{ matrix.image }}"
base_image: "${{ needs.base.outputs.image_tag }}"
base_app_image: "${{ needs['read-matrix'].outputs.base_app_image_arm64 }}"
platforms: "linux/arm64"
runner: "ARM64"
secrets: inherit