Skip to content

Commit

Permalink
Merge pull request #26 from willingc/edit-publishaction
Browse files Browse the repository at this point in the history
use packaging process for build and publish
  • Loading branch information
willingc authored Oct 18, 2024
2 parents 411d4aa + ba88bbb commit 4306c2d
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions .github/workflows/build-book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Expand All @@ -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

0 comments on commit 4306c2d

Please sign in to comment.