From 1072763d02101361eb11734963c469120de2f5c7 Mon Sep 17 00:00:00 2001 From: NAHO <90870942+trueNAHO@users.noreply.github.com> Date: Wed, 21 Aug 2024 18:14:01 +0200 Subject: [PATCH] ci: simplify Docs GitHub workflow Link: https://github.com/danth/stylix/pull/519 Link: https://github.com/trueNAHO/dotfiles/tree/4def3ff8e37a8c0511c34e80ee13c92c8ceea4be/.github/workflows/docs.yml --- .github/workflows/docs.yml | 57 ++++++++++++-------------------------- 1 file changed, 18 insertions(+), 39 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4ec373a50..db56b81b5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,3 +1,4 @@ +--- name: Docs on: @@ -5,53 +6,31 @@ on: branches: - master -jobs: - build: - name: Build - - permissions: - contents: read +concurrency: + cancel-in-progress: true + group: pages +jobs: + docs: runs-on: ubuntu-22.04 - steps: - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v13 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - extra-conf: | - extra-experimental-features = nix-command flakes - - - name: Set up cache - uses: DeterminateSystems/magic-nix-cache-action@v7 - - - name: Build docs - run: nix -L build github:${{ github.repository }}/${{ github.sha }}#docs - - - name: Prepare docs for upload - run: cp -r --dereference --no-preserve=mode,ownership result/ public/ - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: public/ - - deploy: - name: Deploy - - needs: build - permissions: - pages: write + contents: read id-token: write + pages: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-22.04 - steps: - - name: Deploy docs to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v13 + - uses: DeterminateSystems/magic-nix-cache-action@v7 + - run: nix build .#docs + + - uses: actions/upload-pages-artifact@v3 + with: + path: result + + - uses: actions/deploy-pages@v4