diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d5dcf2c..98e0893 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -20,12 +20,39 @@ jobs: - name: Run `nix flake check` run: nix flake check lockfile: + runs-on: ubuntu-22.04 needs: check if: ${{ github.event_name == 'schedule' }} # only run when scheduled - runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: DeterminateSystems/nix-installer-action@v9 - uses: DeterminateSystems/update-flake-lock@v20 - name: Run `nix flake check` run: nix flake check + build-documentation: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'schedule' }} # only run when not scheduled + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v9 + - uses: DeterminateSystems/magic-nix-cache-action@v3 + - name: Build documentation + run: nix build .#docs --print-build-logs + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./result + deploy: + runs-on: ubuntu-latest + needs: build-documentation + if: ${{ github.event_name == 'push' && github.ref == 'main' }} # only run triggered by a push on main + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 7c22adf..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Deploy Documentation - -on: - workflow_dispatch: - push: - branches: [main] - -jobs: - build-website: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@v9 - - uses: DeterminateSystems/magic-nix-cache-action@v3 - - name: Build documentation - run: nix build .#docs --print-build-logs - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - path: ./result - deploy: - needs: build-website - runs-on: ubuntu-latest - permissions: - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2