Skip to content

feat: PR preview deployments on GitHub Pages#14

Merged
Lotes merged 3 commits into
mainfrom
copilot/add-pr-preview-deployment
Mar 12, 2026
Merged

feat: PR preview deployments on GitHub Pages#14
Lotes merged 3 commits into
mainfrom
copilot/add-pr-preview-deployment

Conversation

Copilot AI commented Mar 12, 2026

Copy link
Copy Markdown
Contributor
  • Update next.config.ts: change output to export, add dynamic basePath via NEXT_PUBLIC_BASE_PATH env var, add images.unoptimized: true
  • Update .github/workflows/gh-pages.yml: switch from Pages-API deployment to branch-based deployment using JamesIves/github-pages-deploy-action@v4; set NEXT_PUBLIC_BASE_PATH=/quartett-meister; preserve pr-preview dir with clean-exclude
  • Create .github/workflows/preview.yml: build with PR-scoped basePath (/quartett-meister/pr-preview/pr-{number}), deploy/remove using rossjrw/pr-preview-action@v1
  • Fix PR preview not loading: add .nojekyll to gh-pages root in preview.ymlJamesIves places .nojekyll inside the deployed folder (pr-preview/pr-N/.nojekyll), not the branch root, so Jekyll was silently blocking _next/ asset directories

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Lotes <1525964+Lotes@users.noreply.github.com>
Copilot AI changed the title [WIP] Add PR preview deployment feature feat: PR preview deployments on GitHub Pages Mar 12, 2026
@github-actions

github-actions Bot commented Mar 12, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-03-12 18:48 UTC

@Lotes

Lotes commented Mar 12, 2026

Copy link
Copy Markdown
Owner

@copilot The preview deploy of this PR is not reachable, find out why: https://lotes.github.io/quartett-meister/pr-preview/pr-14/

…xt/ assets

Co-authored-by: Lotes <1525964+Lotes@users.noreply.github.com>

Copilot AI commented Mar 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot The preview deploy of this PR is not reachable, find out why: https://lotes.github.io/quartett-meister/pr-preview/pr-14/

Found the root cause (commit 03ad946):

JamesIves/github-pages-deploy-action@v4 creates .nojekyll inside the source folder being deployed (out/.nojekyll). Because rossjrw/pr-preview-action deploys to a target-folder (pr-preview/pr-14), the .nojekyll file landed at pr-preview/pr-14/.nojekyll in the gh-pages branch — not at the branch root. GitHub Pages runs Jekyll by default when there's no .nojekyll at the root, and Jekyll silently blocks every directory whose name starts with _. Next.js puts all JS and CSS under _next/, so the page HTML loaded (the "Lade…" spinner was served) but every script and stylesheet was 404'd.

Fix: two new steps in preview.yml before rossjrw/pr-preview-action:

  1. Create a temp dir containing only an empty .nojekyll file
  2. Deploy that dir to the gh-pages branch root via JamesIves/github-pages-deploy-action@v4 with clean: false (adds .nojekyll without touching anything else)

The next time the PR preview workflow runs (on the next push to this branch) the preview at https://lotes.github.io/quartett-meister/pr-preview/pr-14/ should be fully functional.

Copilot AI requested a review from Lotes March 12, 2026 18:44
@Lotes Lotes marked this pull request as ready for review March 12, 2026 18:48
@Lotes Lotes merged commit 23beed3 into main Mar 12, 2026
1 check passed
@Lotes Lotes deleted the copilot/add-pr-preview-deployment branch March 12, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants