|
| 1 | +name: bluebuild |
| 2 | +on: |
| 3 | + push: |
| 4 | + paths-ignore: # don't rebuild if only documentation has changed |
| 5 | + - "**.md" |
| 6 | + |
| 7 | + pull_request: |
| 8 | + workflow_dispatch: # allow manually triggering builds |
| 9 | +jobs: |
| 10 | + rcl: |
| 11 | + name: Build recipe files with rcl |
| 12 | + runs-on: ubuntu-latest |
| 13 | + outputs: |
| 14 | + recipe-matrix: ${{ steps.rcl.outputs.recipe-matrix }} |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Install rcl |
| 20 | + run: | |
| 21 | + git clone https://github.com/ruuda/rcl.git /tmp/rcl |
| 22 | + cd /tmp/rcl && cargo build --release |
| 23 | + sudo cp target/release/rcl /usr/local/bin/ |
| 24 | +
|
| 25 | + - name: Build recipe files |
| 26 | + id: rcl |
| 27 | + run: | |
| 28 | + RCL_OUTPUT=$(rcl build ./100-rcl/recipes.rcl) |
| 29 | + RECIPE_FILENAMES=$(echo "$RCL_OUTPUT" | awk '{ print $2 }' | sed -e 's/^recipes\///') |
| 30 | + RECIPE_FILENAMES_JSON=$(echo "$RECIPE_FILENAMES" | jq --compact-output --raw-input '[inputs]') |
| 31 | + MATRIX_JSON=$(jq -cn --argjson recipes "${RECIPE_FILENAMES_JSON[@]}" '{ recipes: $recipes }') |
| 32 | +
|
| 33 | + echo "recipe-matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT |
| 34 | +
|
| 35 | + - uses: actions/upload-artifact@v4 |
| 36 | + with: |
| 37 | + name: recipes |
| 38 | + path: ./100-rcl/recipes/ |
| 39 | + bluebuild: |
| 40 | + name: Build Custom Image |
| 41 | + runs-on: ubuntu-latest |
| 42 | + permissions: |
| 43 | + contents: read |
| 44 | + packages: write |
| 45 | + id-token: write |
| 46 | + needs: rcl |
| 47 | + strategy: |
| 48 | + fail-fast: false # stop GH from cancelling all matrix builds if one fails |
| 49 | + matrix: ${{ fromJson(needs.rcl.outputs.recipe-matrix) }} |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v4 |
| 52 | + - uses: actions/download-artifact@v4 |
| 53 | + with: |
| 54 | + name: recipes |
| 55 | + path: ./100-rcl/recipes/ |
| 56 | + |
| 57 | + - name: Build Custom Image |
| 58 | + uses: blue-build/[email protected] |
| 59 | + with: |
| 60 | + recipe: ${{ matrix.recipe }} |
| 61 | + working_directory: ./100-rcl |
| 62 | + cosign_private_key: ${{ secrets.SIGNING_SECRET }} |
| 63 | + registry_token: ${{ github.token }} |
| 64 | + pr_event_number: ${{ github.event.number }} |
| 65 | + skip_checkout: true |
0 commit comments