wait on demo build to succeed (#334)
This commit is contained in:
parent
61faa8fc73
commit
51c90e13e6
1 changed files with 32 additions and 8 deletions
40
.github/workflows/demo.yml
vendored
40
.github/workflows/demo.yml
vendored
|
@ -3,18 +3,31 @@ name: Demo
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
|
||||||
- '.github/workflows/demo.yml'
|
|
||||||
- 'demo/**'
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
|
||||||
- '.github/workflows/demo.yml'
|
|
||||||
- 'demo/**'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
path-filter:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
changed: ${{ steps.filter.outputs.changed }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: dorny/paths-filter@v3
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
changed:
|
||||||
|
- '.github/workflows/demo.yml'
|
||||||
|
- 'demo/**'
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
needs: [ "path-filter" ]
|
||||||
|
if: needs.path-filter.outputs.changed == 'true'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
demo:
|
demo:
|
||||||
|
@ -41,7 +54,7 @@ jobs:
|
||||||
|
|
||||||
- uses: cachix/cachix-action@v14
|
- uses: cachix/cachix-action@v14
|
||||||
with:
|
with:
|
||||||
name: mycache
|
name: selfhostblocks
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
|
|
||||||
- name: Build ${{ matrix.demo.name }} .#${{ matrix.demo.flake }}
|
- name: Build ${{ matrix.demo.name }} .#${{ matrix.demo.flake }}
|
||||||
|
@ -53,4 +66,15 @@ jobs:
|
||||||
--show-trace \
|
--show-trace \
|
||||||
build .#nixosConfigurations.${{ matrix.demo.flake }}.config.system.build.vm
|
build .#nixosConfigurations.${{ matrix.demo.flake }}.config.system.build.vm
|
||||||
|
|
||||||
|
result:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ "build" ]
|
||||||
|
if: '!cancelled()'
|
||||||
|
steps:
|
||||||
|
- run: |
|
||||||
|
result="${{ needs.tests.result }}"
|
||||||
|
if [[ $result == "success" || $result == "skipped" ]]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue