Static sites
pages serves folders of static files. A deploy is one upload, immutable, at
https://<id>.pages.xvii.network. An alias is a stable name, https://<name>.pages.xvii.network, pointing
at one deploy at a time. See also: the pages service.
Deploy
xvii pages deploy # dist, build, out or public
xvii pages deploy site --name my-site # and point the alias my-site at it
xvii pages deploy --watch --name wip # redeploy on every save
Git details (project, branch, commit and its message) are recorded when the folder is in a repository,
and show in the panel. Uploading an archive (.zip, .tar.gz) in the panel works too.
Lifetimes and cleanup
Every deploy has a lifetime, two weeks by default (the instance can change it). Expired deploys are
removed with their files, except:
- deploys an alias points at, or has in its history;
- deploys marked to keep:
xvii pages keep 3f9a2b1c (or --keep when deploying).
xvii pages ttl 3f9a2b1c 7d # a new lifetime, counted from now
xvii pages ttl 3f9a2b1c never
Aliases and rollbacks
xvii pages alias my-site 3f9a2b1c # point it at a deploy
xvii pages rollback my-site # back to the previous one
xvii pages aliases # where every alias points
xvii pages unalias my-site # remove it (the deploys stay)
Deleting a deploy moves its aliases to their previous deploy. To see what a deploy changed:
xvii pages diff my-site # the alias against one rollback ago
xvii pages files 3f9a2b1c --filter .js
Access
xvii pages password my-site s3cret # basic auth, any user name
xvii pages password my-site --off # back to the default
xvii pages password 3f9a2b1c --public # open even when the server has a default password
A password can sit on a deploy, an alias, or the whole server (an instance setting); the most specific
one wins.
Single-page apps, redirects and headers
--spa serves index.html for paths that are not files.
_redirects and _headers in the folder's root follow the Netlify / Cloudflare Pages syntax:
splats, placeholders, status codes 200 (rewrite), 301, 302, 404.
404.html is served for missing paths.
/docs /docs/getting-started 302
/old/* /new/:splat 301
/app/* /app/index.html 200
Custom domains
xvii pages domains my-site add www.example.com # prints the records to create
xvii pages domains my-site check www.example.com
xvii pages domains my-site records www.example.com --zone > zone.txt
A TXT record proves ownership; a CNAME (or A records for a bare domain) points the name at pages. Pending
domains are checked every ten minutes for a day; the certificate is issued on the first visit. If the
zone is in domains, attach the name there instead: it creates the records for you.
Previews in CI
pages serves a GitLab CI template:
include:
- remote: https://pages.xvii.network/ci/preview.yml
variables:
PAGES_DIR: dist # the built site, an artifact of an earlier job
PAGES_NAME: my-site # optional, defaults to the project name
The default branch lands on my-site.pages.xvii.network, other branches on
my-site-<branch>.pages.xvii.network, linked from the merge request as an environment. Merging or deleting
the branch removes its preview. For sign-in, add a trust rule for the repository in id (the project's CI
tab); then no token is stored. GitHub Actions: https://pages.xvii.network/ci/github.yml. See
Deploy from CI.
Analytics and errors on a site
Link an alias to an analytics site or an error project (from those panels, or the alias's sheet in
pages): pages puts their scripts into every HTML page it serves for that alias. No build change needed.
Teams and limits
Deploys and aliases belong to a team, optionally a project and environment. Members see them, developers
and up change them. Limits: pages.deploys, pages.storage, pages.deploy_size
(Limits).