diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index de115cc..5bd012b 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -49,11 +49,28 @@ jobs: if: success() env: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - run: nix build ".#top.${{ matrix.system }}" --json | jq -r .[].drvPath | cachix push hsndev - - name: Push Deployment to runners - if: success() - env: - CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN }} run: | - spec=$(nix build --print-out-paths) - cachix deploy activate $spec \ No newline at end of file + nix build .#deploy-json --print-out-paths | cachix push hsndev + + nix-build-success: + if: ${{ always() }} + needs: + - nix-build + name: Nix Build Successful + runs-on: docker + steps: + - if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + name: Check matrix status + run: exit 1 + deploy: + if: success() + needs: + - nix-build-success + runs-on: docker + env: + CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN }} + steps: + - name: Deploy Runners + run: | + spec=$(nix build .#deploy-json --print-out-paths) + cachix deploy activate $spec