diff --git a/.github/workflows/build-book.yml b/.github/workflows/build-book.yml index a3c2be7..6a20960 100644 --- a/.github/workflows/build-book.yml +++ b/.github/workflows/build-book.yml @@ -49,6 +49,15 @@ jobs: path: | _build/html/ + # Push the book's HTML to github-pages + - name: Push to GitHub Pages + # Only push if on main branch + if: github.ref == 'refs/heads/main' + uses: peaceiris/actions-gh-pages@v4.0.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_build/html + # Test for bad links and ensure alt tags for usability - name: Check HTML using htmlproofer uses: chabad360/htmlproofer@master @@ -58,26 +67,3 @@ jobs: --ignore-files "/.+\/_static\/.+/,/genindex.html/" --ignore-status-codes "404, 403, 429, 503" continue-on-error: true - - publish-book: - runs-on: ubuntu-latest - needs: build-book - if: github.ref == 'refs/heads/main' - permissions: - pages: write - id-token: write - contents: read - steps: - - uses: actions/checkout@v4 - - # Download the artifact from the build job - - name: Download book html artifact - uses: actions/download-artifact@v4 - with: - name: book-html - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 - with: - artifact_name: book-html