From bbc8651dc892dc9d2883af3c667c3173da1b7425 Mon Sep 17 00:00:00 2001 From: AtHeartEngineer Date: Mon, 21 Aug 2023 11:57:05 -0400 Subject: [PATCH] gha update --- .github/workflows/gh-pages.yml | 54 ++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index eed8d1e..a85bf1d 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -1,33 +1,55 @@ -name: github pages +name: Deploy mdBook site to Pages on: push: branches: - main pull_request: + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: 'pages' + cancel-in-progress: false jobs: - deploy: - runs-on: ubuntu-20.04 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + build: + runs-on: ubuntu-latest + env: + MDBOOK_VERSION: 0.4.21 steps: - uses: actions/checkout@v3 - - name: Install cargo-sort from git + - name: Install book-summary from cargo uses: baptiste0928/cargo-install@v2 with: crate: book-summary - run: book-summary -n ./src -s cryptkeeper guides references -y - - name: Setup mdBook - uses: peaceiris/actions-mdbook@v1 - with: - mdbook-version: 'latest' - - run: mdbook build + - name: Install mdBook + run: curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh rustup update && cargo install --version ${MDBOOK_VERSION} mdbook - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.ref == 'refs/heads/main' }} + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + - name: Build with mdBook + run: mdbook build + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./book + path: ./book + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2