This repo (fork) uses GitHub Actions to build and publish previews and the main site.
Essentials
- Repo that should run Actions:
RedTurtle/design-scuole-pagine-statiche(workflows guard on repository name). - Previews: pushed branches run
preview-deploy.ymland publish togh-pages/previews/<branch>/. - Production:
deploy-gh-pages.ymlpublishesdist/to GitHub Pages whenmainis pushed. - Cleanup:
cleanup-previews.ymlremovespreviews/<branch>/fromgh-pageswhen the PR is merged.
What to enable in GitHub settings
- Settings → Actions
- Ensure Actions are enabled for your fork (Allow all actions or allow local only).
- Settings → Pages
- Source: use GitHub Actions (the workflows publish to
gh-pagesbranch).
- Source: use GitHub Actions (the workflows publish to
How previews work (PR workflow)
- When you push a branch to the fork, the
preview-deploy.ymlworkflow runs (only inRedTurtle/...). - It builds the site (
pnpm build) and publishesdist/undergh-pages/previews/<branch>/. - The workflow comments the PR with the preview URL — paste it in the upstream PR description if needed.
- When the PR is merged,
cleanup-previews.ymlremoves that preview directory.
Local testing
pnpm install
pnpm build
pnpm preview
# open http://localhost:5173/index.htmlSecurity notes
- All workflows are guarded to run only if
github.repository == 'RedTurtle/design-scuole-pagine-statiche'. - We do not push changes to the upstream
italia/...repository. - Secrets are not exposed to upstream PRs; workflows run in the context of the fork.
If you want changes to the trigger rules (e.g. restrict which branch prefixes create previews), tell me and I'll update preview-deploy.yml accordingly.