refactor images.yml into reusable workflow #96
Workflow file for this run
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: images | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
permissions: | ||
contents: read | ||
packages: write | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
config: | ||
name: Read config | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.kernel.outputs.matrix }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Read versions.json | ||
id: kernel | ||
run: | | ||
echo "matrix<<EOF" | ||
cat versions.json | ||
echo -e "\nEOF" | ||
build-and-push: | ||
name: Build And Push | ||
needs: config | ||
uses: ./.github/workflows/build-and-push.yml | ||
strategy: | ||
matrix: ${{ fromJSON(needs.config.outputs.matrix) }} | ||
with: | ||
kernel_version: ${{ matrix.version }} | ||
build_selftests: ${{ matrix.tag != "" }} | ||
Check failure on line 45 in .github/workflows/images.yml GitHub Actions / imagesInvalid workflow file
|
||
build_arm64: ${{ matrix.tag != "" }} | ||
static_tag1: ${{ matrix.tag }} | ||
results: | ||
if: ${{ always() }} | ||
runs-on: ubuntu-latest | ||
name: Results | ||
needs: | ||
- build-and-push | ||
steps: | ||
- run: exit 1 | ||
if: >- | ||
${{ | ||
contains(needs.*.result, 'failure') | ||
|| contains(needs.*.result, 'cancelled') | ||
}} |