diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0dd2d21..881d3f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,10 +5,17 @@ on: push: branches: ["master"] -# Allow one concurrent deployment +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: - group: "build" - cancel-in-progress: true + group: "pages" + cancel-in-progress: false jobs: # Build job @@ -34,12 +41,18 @@ jobs: command: test doc: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: [ build ] # for ignoring bad builds if: github.event_name == 'push' && github.ref == 'refs/heads/master' steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Setup Pages + uses: actions/configure-pages@v4 - name: Install Rust uses: actions-rs/toolchain@v1 @@ -49,8 +62,12 @@ jobs: - name: Build Docs run: cargo doc --no-deps --document-private-items - - name: Deploy To Pages - uses: peaceiris/actions-gh-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./target/doc \ No newline at end of file + # Upload entire repository + path: './target/doc' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file