From 465268c1942d12a5d2e74b908e8475ea2aebe6fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 18 Feb 2024 16:51:03 +0100 Subject: [PATCH] feat(ci): Merge all workflows into one file --- .github/workflows/check.yml | 29 ++++++++++++++++++++++++++++- .github/workflows/deploy.yml | 33 --------------------------------- 2 files changed, 28 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/deploy.yml 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