Add static build pipeline for GitHub Pages deployment #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Converts Express/EJS app to static HTML for GitHub Pages hosting. EJS templates are rendered at build time with default context values, and output is deployed to
gh-pagesbranch on push tomain.Changes
scripts/build-static.js- Build script that:views/→docs/*.htmlpublic/→docs/public/partials/andincludes/directoriesdocs/index.htmlfromshop/home.ejs.nojekyllto prevent Jekyll processing.github/workflows/deploy-pages.yml- CI workflow usingpeaceiris/actions-gh-pages@v3to deploydocs/togh-pagesbranchpackage.json- Addedbuild:staticscript andfs-extra/globdev dependencies.gitignore- Excludesdocs/build outputUsage
npm ci npm run build:static # open docs/index.html to verifyNotes
Templates are rendered with empty/default context values. Pages requiring dynamic data (DB queries, session state) will fail to render and are logged as warnings—these need manual conversion or a data source.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com//advisories/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Goal: Convert the existing Express/EJS site into a static build and automatically deploy it to GitHub Pages (gh-pages branch) on every push to main. The repository currently uses EJS templates in views/ and static assets in public/. GitHub Pages cannot run Node/Express, so we will render EJS into plain HTML and publish the output.
Required changes to implement:
File content (scripts/build-static.js):
"build:static": "node scripts/build-static.js"
If package.json already has a scripts object, only add the new key.
Workflow content (.github/workflows/deploy-pages.yml):
Optional: If you prefer GitHub Pages to read from main/docs (instead of gh-pages), the workflow can commit docs/ back to main. Current plan: publish to gh-pages branch and instruct Pages to use gh-pages branch in repo settings. The action will create/update gh-pages automatically.
Tests to verify locally after merge (instructions for you):
This pull request was created as a result of the following prompt from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.