Add GitHub Actions workflow for CI and GitHub Pages deployment - #1354
Add GitHub Actions workflow for CI and GitHub Pages deployment#1354pcottle wants to merge 1 commit into
Conversation
✅ Deploy Preview for xenodochial-hugle-b9ec84 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd19e5021e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| publish_branch: github-pages | ||
| publish_dir: . |
There was a problem hiding this comment.
Publish build output instead of repository root
On GitHub Actions runners CI=true, and gulp build writes the entry page to build/index.html (see gulpfile.js around lines 114-116) rather than creating a root index.html. Deploying publish_dir: . therefore pushes a tree whose root has no generated index page, so GitHub Pages can serve a 404 or stale content from previous commits. Point publish_dir at build (or change the CI build output path) so the generated site root is what gets published.
Useful? React with 👍 / 👎.
Motivation
mainand enable automated deployment to agithub-pagesbranch for GitHub Pages hosting.workflow_dispatch.Description
.github/workflows/pages-deploy.ymlto register a workflow that runs onpull_requestandpushtomainand supportsworkflow_dispatch.verifyjob that checks out the code, sets up Node.js 18, installs Yarn Classic, runsyarn install --frozen-lockfile, and executesyarn gulp build(tests + lint + build).deployjob (dependent onverify) that runs only on pushes tomain, builds production assets, and deploys the repository tree to thegithub-pagesbranch usingpeaceiris/actions-gh-pages@v4withpublish_dirset to.andforce_orphan: true.contents: write) and concurrency grouping withpages-${{ github.ref }}to cancel in-progress runs for the same ref.Testing
yarn gulp build(which includes tests, lint, and build) in theverifyjob for PRs and pushes tomainto validate changes.Codex Task