Skip to content

Commit f9ed586

Browse files
committed
Modified
1 parent d1414c5 commit f9ed586

2 files changed

Lines changed: 25 additions & 25 deletions

File tree

.github/workflows/pages.yml

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,46 +22,45 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
jobs:
25-
deploy:
26-
name: Deploy Docs Website
25+
build:
26+
name: Build Docs Website
2727
runs-on: ubuntu-latest
28-
environment:
29-
name: github-pages
30-
url: ${{ steps.deployment.outputs.page_url }}
3128

3229
steps:
3330
- name: Checkout
3431
uses: actions/checkout@v4
3532

36-
- name: Check whether GitHub Pages is enabled
37-
id: pages_status
38-
shell: bash
39-
run: |
40-
status_code="$(curl -sS -o /tmp/pages.json -w '%{http_code}' \
41-
-H 'Accept: application/vnd.github+json' \
42-
-H 'Authorization: Bearer ${{ github.token }}' \
43-
"https://api.github.com/repos/${{ github.repository }}/pages")"
44-
45-
if [ "$status_code" = "200" ]; then
46-
echo "enabled=true" >> "$GITHUB_OUTPUT"
47-
echo "GitHub Pages is enabled for this repository."
48-
else
49-
echo "enabled=false" >> "$GITHUB_OUTPUT"
50-
echo "::notice title=GitHub Pages not enabled::Enable Pages in Settings -> Pages and set Source to GitHub Actions, then rerun this workflow."
51-
cat /tmp/pages.json || true
52-
fi
33+
- name: Set up Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: "22"
5337

5438
- name: Configure Pages
55-
if: steps.pages_status.outputs.enabled == 'true'
5639
uses: actions/configure-pages@v5
5740

41+
- name: Validate docs website shell
42+
shell: bash
43+
run: |
44+
node --check docs/website/app.js
45+
test -f docs/website/index.html
46+
test -f docs/website/styles.css
47+
test -f docs/website/web_assets/favicon.ico
48+
test -f docs/website/.nojekyll
49+
5850
- name: Upload static site artifact
59-
if: steps.pages_status.outputs.enabled == 'true'
6051
uses: actions/upload-pages-artifact@v3
6152
with:
6253
path: docs/website
6354

55+
deploy:
56+
name: Deploy Docs Website
57+
runs-on: ubuntu-latest
58+
needs: build
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
63+
steps:
6464
- name: Deploy to GitHub Pages
65-
if: steps.pages_status.outputs.enabled == 'true'
6665
id: deployment
6766
uses: actions/deploy-pages@v4

docs/website/.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)