Skip to content

Commit

Permalink
ci: read matrix output
Browse files Browse the repository at this point in the history
  • Loading branch information
DrummyFloyd committed Jan 7, 2025
1 parent e6bd628 commit f25502a
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/auto-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,26 @@ jobs:
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: [base, base-app]
needs: [read-matrix]
strategy:
matrix:
image:
Expand All @@ -62,11 +80,11 @@ jobs:
with:
image_name: "${{ matrix.image }}"
base_image: "${{ needs.base.outputs.image_tag }}"
base_app_image: "${{ needs.base-app.outputs.image_tag }}"
base_app_image: "${{ needs['read-matrix'].outputs.base_app_image_amd64 }}"
secrets: inherit

apps-arm64:
needs: [base, base-app]
needs: [read-matrix]
strategy:
matrix:
image:
Expand All @@ -76,7 +94,7 @@ jobs:
with:
image_name: "${{ matrix.image }}"
base_image: "${{ needs.base.outputs.image_tag }}"
base_app_image: "${{ needs.base-app.outputs.image_tag }}"
base_app_image: "${{ needs['read-matrix'].outputs.base_app_image_arm64 }}"
platforms: "linux/arm64"
runner: "ARM64"
secrets: inherit

0 comments on commit f25502a

Please sign in to comment.