Skip to content

Commit 5266ae6

Browse files
authored
fix: move build to it's own envt step (#627)
1 parent a681cb2 commit 5266ae6

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

.github/workflows/build-book.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616
pages: write
1717
id-token: write
1818

19-
# This job installs dependencies, build the book, and pushes it to `gh-pages`
19+
# Build and test the book, then deploy from a separate job.
2020
jobs:
2121
build-test-book:
2222
runs-on: ubuntu-latest
@@ -74,17 +74,24 @@ jobs:
7474
with:
7575
path: ./_build/html
7676

77-
- name: Deploy to GitHub Pages
78-
# Only push if on main branch
79-
if: github.ref == 'refs/heads/main'
80-
id: deployment
81-
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 #v5.0.0
82-
8377
# Test for bad links and ensure alt tags for usability
8478
- name: Check HTML using htmlproofer
79+
continue-on-error: true
8580
uses: chabad360/htmlproofer@master
8681
with:
8782
directory: "_build/html"
8883
arguments: |
8984
--ignore-files "/.+\/_static\/.+/,/genindex.html/"
9085
--ignore-status-codes "0, 200, 401, 403, 429, 503"
86+
87+
deploy:
88+
if: github.ref == 'refs/heads/main'
89+
needs: build-test-book
90+
runs-on: ubuntu-latest
91+
environment:
92+
name: github-pages
93+
url: ${{ steps.deployment.outputs.page_url }}
94+
steps:
95+
- name: Deploy to GitHub Pages
96+
id: deployment
97+
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 #v5.0.0

0 commit comments

Comments
 (0)