Skip to content

Commit 0f986ee

Browse files
author
FaulMit
committed
Handle disabled GitHub Pages in demo workflow
1 parent 8d2767f commit 0f986ee

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/pages.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,36 @@ jobs:
2828
- name: Checkout
2929
uses: actions/checkout@v5
3030

31+
- name: Check Pages configuration
32+
id: pages
33+
env:
34+
GH_TOKEN: ${{ github.token }}
35+
GH_REPO: ${{ github.repository }}
36+
run: |
37+
status="$(curl -sS -o /tmp/pages.json -w "%{http_code}" \
38+
-H "Authorization: Bearer ${GH_TOKEN}" \
39+
-H "Accept: application/vnd.github+json" \
40+
"https://api.github.com/repos/${GH_REPO}/pages")"
41+
42+
if [ "$status" = "200" ]; then
43+
echo "enabled=true" >> "$GITHUB_OUTPUT"
44+
echo "GitHub Pages is enabled."
45+
else
46+
echo "enabled=false" >> "$GITHUB_OUTPUT"
47+
echo "::notice title=GitHub Pages is not enabled::Open Settings > Pages and set Build and deployment Source to GitHub Actions, then rerun this workflow."
48+
fi
49+
3150
- name: Configure Pages
51+
if: steps.pages.outputs.enabled == 'true'
3252
uses: actions/configure-pages@v5
3353

3454
- name: Upload static site
55+
if: steps.pages.outputs.enabled == 'true'
3556
uses: actions/upload-pages-artifact@v4
3657
with:
3758
path: public
3859

3960
- name: Deploy to GitHub Pages
61+
if: steps.pages.outputs.enabled == 'true'
4062
id: deployment
4163
uses: actions/deploy-pages@v4

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ npm run pack # unpacked desktop build
203203

204204
The GitHub Pages demo publishes the `public/` folder and enables `demo-api.js` automatically outside localhost. It is useful for clicking through the interface, but all hardware data, benchmarks, stress tests, native runners, updates, and community sync are simulated.
205205

206+
If the Demo Site workflow says GitHub Pages is not enabled, open repository Settings > Pages and set Build and deployment Source to GitHub Actions, then rerun the workflow.
207+
206208
Release docs: [docs/RELEASE.md](docs/RELEASE.md).
207209

208210
## Security Model

0 commit comments

Comments
 (0)