Skip to content

Commit

Permalink
ci: conditional jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
terlar committed Sep 10, 2024
1 parent b672c89 commit 79dce06
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,35 @@ on:
- main

jobs:
changes:
runs-on: ubuntu-latest
outputs:
src: ${{ steps.changes.outputs.src }}
infra: ${{ steps.changes.outputs.infra }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
nixos-configuration:
- flake.nix
- flake.lock
- 'configurations/nixos/**'
- 'modules/nixos/**'
- 'modules/home/**'
home-configuration:
- flake.nix
- flake.lock
- 'configurations/home/**'
- 'modules/home/**'
installer-yubikey:
- flake.nix
- flake.lock
- 'configurations/nixos/installer-yubikey/**'
- 'packages/drduh-gpg-conf/**'
- 'packages/drduh-yubikey-guide/**'
check:
runs-on: ubuntu-latest
steps:
Expand All @@ -33,6 +62,8 @@ jobs:
run: nix flake check

build-home-configuration:
needs: changes
if: ${{ needs.changes.outputs.home-configuration == 'true' }}
strategy:
matrix:
include:
Expand Down Expand Up @@ -61,6 +92,8 @@ jobs:
nix build --print-build-logs .#homeConfigurations.${{ matrix.username }}.activationPackage
build-nixos-configuration:
needs: changes
if: ${{ needs.changes.outputs.nixos-configuration == 'true' }}
strategy:
matrix:
host:
Expand Down Expand Up @@ -89,6 +122,8 @@ jobs:
nix build --print-build-logs .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel
build-iso:
needs: changes
if: ${{ needs.changes.outputs.installer-yubikey == 'true' }}
strategy:
matrix:
name:
Expand Down

0 comments on commit 79dce06

Please sign in to comment.