2024-08-15 07:13:00 +02:00
|
|
|
name: Demo
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
pull_request:
|
2024-08-15 07:49:01 +02:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2024-08-15 07:13:00 +02:00
|
|
|
|
|
|
|
jobs:
|
2024-10-26 23:08:18 +02:00
|
|
|
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/**'
|
|
|
|
|
2024-08-15 07:13:00 +02:00
|
|
|
build:
|
2024-10-26 23:08:18 +02:00
|
|
|
needs: [ "path-filter" ]
|
|
|
|
if: needs.path-filter.outputs.changed == 'true'
|
2024-08-15 07:13:00 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
demo:
|
|
|
|
- name: homeassistant
|
|
|
|
flake: basic
|
|
|
|
- name: homeassistant
|
|
|
|
flake: ldap
|
|
|
|
|
|
|
|
- name: nextcloud
|
|
|
|
flake: basic
|
|
|
|
- name: nextcloud
|
|
|
|
flake: ldap
|
|
|
|
- name: nextcloud
|
|
|
|
flake: sso
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2024-08-15 08:57:57 +02:00
|
|
|
uses: actions/checkout@v4
|
2024-08-15 07:13:00 +02:00
|
|
|
|
|
|
|
- name: Install nix
|
|
|
|
uses: cachix/install-nix-action@v20
|
|
|
|
|
2024-08-15 08:57:57 +02:00
|
|
|
- uses: cachix/cachix-action@v14
|
|
|
|
with:
|
2024-10-26 23:08:18 +02:00
|
|
|
name: selfhostblocks
|
2024-08-15 08:57:57 +02:00
|
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
|
|
|
2024-08-15 07:13:00 +02:00
|
|
|
- name: Build ${{ matrix.demo.name }} .#${{ matrix.demo.flake }}
|
|
|
|
run: |
|
|
|
|
cd demo/${{ matrix.demo.name }}
|
|
|
|
nix \
|
|
|
|
--print-build-logs \
|
|
|
|
--option keep-going true \
|
|
|
|
--show-trace \
|
|
|
|
build .#nixosConfigurations.${{ matrix.demo.flake }}.config.system.build.vm
|
|
|
|
|
2024-10-26 23:08:18 +02:00
|
|
|
result:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [ "build" ]
|
|
|
|
if: '!cancelled()'
|
|
|
|
steps:
|
|
|
|
- run: |
|
2024-10-27 02:35:50 +01:00
|
|
|
result="${{ needs.build.result }}"
|
2024-10-26 23:08:18 +02:00
|
|
|
if [[ $result == "success" || $result == "skipped" ]]; then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|