diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index c65c9e0f0..a79aa4106 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -7,38 +7,39 @@ on: paths: - 'README.md' - 'docs/book/**' - pull_request: - paths: - - 'README.md' - - 'docs/book/**' + +permissions: + contents: read + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source jobs: - deploy: + generate-docs: runs-on: ubuntu-latest - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment - - permissions: - pages: write # to deploy to Pages - id-token: write # to verify the deployment originates from an appropriate source - - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - + timeout-minutes: 2 steps: - uses: actions/checkout@v4 - - name: Setup mdBook uses: peaceiris/actions-mdbook@v1 with: mdbook-version: '0.4.35' - - - run: cd docs/book && mdbook build - - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.ref == 'refs/heads/main' }} + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Build with mdBook + run: cd docs/book && mdbook build + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/book - user_name: 'github-actions[bot]' - user_email: 'github-actions[bot]@users.noreply.github.com' + path: 'docs/book/book' + + deploy-page: + needs: generate-docs + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + timeout-minutes: 2 + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4