Removing Pr-Preview from netlify, moving to GitHub page#7595
Removing Pr-Preview from netlify, moving to GitHub page#7595saurabhraghuvanshii wants to merge 15 commits intolayer5io:masterfrom
Conversation
|
Thanks for taking this on, @saurabhraghuvanshii. Moving PR previews from Netlify to GitHub Pages is a meaningful infrastructure change that reduces our external dependency, and the workflow changes look structurally sound. A few things to address before merge:
The intent is right. Please flesh out the description and confirm the new workflow is functional. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR migrates PR preview deployments from Netlify to GitHub Pages, adjusting Gatsby configuration and SEO behavior to support prefixed paths and prevent preview pages from being indexed.
Changes:
- Add GitHub Pages–specific build scripts (with
--prefix-paths) and a dedicated preview build mode (GATSBY_PREVIEW). - Update Gatsby
siteUrl/pathPrefixhandling and disable sitemap/robots plugins during preview builds. - Replace Netlify-based preview workflow with a GitHub Pages PR preview workflow (create/update on PR pushes; remove on PR close).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/seo.js | Builds absolute meta URLs with prefixes and adds noindex for preview builds. |
| package.json | Adds build scripts for GitHub Pages and preview builds using --prefix-paths. |
| gatsby-config.js | Derives siteUrl/pathPrefix from env and disables sitemap/robots in preview builds. |
| .github/workflows/preview-site.yml | Removes Netlify deployment workflow. |
| .github/workflows/build-and-preview-site.yml | Builds + deploys PR previews to gh-pages and comments the preview URL. |
| .github/workflows/build-and-deploy-site.yml | Deploys production site to gh-pages, handling project-pages vs org-pages pathing. |
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: Saurabh Singh <saurabhsraghuvanshi@gmail.com>
Signed-off-by: Saurabh Singh <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
59b0bbd to
12ea90c
Compare
Description
.github/workflows/build-and-deploy-site.ymlPUBLIC_SITE_URL) → root buildPATH_PREFIX=<repo>).nojekyllis presentpublic/CNAMEfromPUBLIC_SITE_URLhost to prevent GitHub Pages from resetting the domain to*.github.iogh-pageswithkeep_files: trueto preserve PR preview directories.github/workflows/build-and-preview-site.ymlpull_request_target(opened,synchronize,reopened,closed)PREVIEW_SITE_URLPUBLIC_SITE_URLPATH_PREFIXcorrectly for:/pr-preview/pr-<n>/<base-path>/pr-preview/pr-<n>/<repo>/pr-preview/pr-<n>build:previewrobots.txt(deny all)pr-preview-actiongatsby-config.jsisPreviewBuildsiteOriginpathPrefixsiteRootUrlsiteMetadata.permalinksiteMetadata.siteUrlfrom runtime build inputs
pathPrefixwhen providedsrc/components/seo.jsnoindex, nofollowmeta tags for preview buildspackage.jsonbuild:gh-pages→gatsby build --prefix-pathsbuild:preview→GATSBY_PREVIEW=true gatsby build --prefix-pathsgatsby-node.jsonPostBuild)This PR fixes #
Notes for Reviewers
Signed commits