Home Documentation Templates Examples Showcase GitHub
Theme

Platform target

GitHub Pages

GitHub Pages needs no special Nift output format, so this target deliberately keeps the ordinary public/ artifact. The value is consistent initialization and a dedicated deployment guide, not invented provider metadata.

nift init --target=github-pages
nift build

What Nift creates

The project layout is the normal Nift HTML starter with public/ as its output directory. No provider file is created because Pages can deploy an arbitrary static artifact from a custom GitHub Actions workflow.

Actions deployment

A Pages workflow normally checks out the repository, makes Nift available, runs the build, uploads public/ with actions/upload-pages-artifact, then deploys it with actions/deploy-pages.

permissions:
  contents: read
  pages: write
  id-token: write

# ... checkout + install Nift ...
# run: nift build
# uses: actions/upload-pages-artifact@v4
#   with: { path: public }
# uses: actions/deploy-pages@v4

Nift does not generate the complete workflow because the correct Nift installation step depends on the distribution/version policy you choose for that repository.

Dynamic behaviour

GitHub Pages is static hosting. If the frontend needs runtime APIs, host them elsewhere—serverless functions, a conventional backend, Supabase, or another service—and call them over HTTPS.

Project-site paths

Repository project sites are normally served under /repository-name/, unlike account/organization Pages sites at the domain root. Keep that base-path difference in mind for absolute URLs and application routing.

Official references: custom workflows, Pages overview, and limits.