Deploying Your Site
If you want to make others see your site, you’ll have to make it available somewhere! You’ll need to do these things:
- Setting up the workflow
- Building the site
- Deploying the site
GitHub Actions and Pages
Use the following CI file:
# The name of your workflow. Always specify the name!
name: Build Docs
# Events that would trigger your workflow
on:
# In this case we would like to build the documentation
# whenever new commits are pushed to the `main` branch
push:
branches: [main]
# Or, if you want to manually trigger the workflow,
# use `workflow_dispatch`
workflow_dispatch:
# necessary permissions required for deploying the document
permissions:
contents: read
pages: write
id-token: write
# What jobs would be involved in building the document
jobs:
# Job 1: build the docs
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: DeterminateSystems/nix-installer-action@v20
- uses: DeterminateSystems/magic-nix-cache-action@v13
- name: Build docs
run: nix develop .#default --command time just full-docs
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
# Job 2: deploy the docs
deploy:
needs: build-docs
runs-on: ubuntu-latest
environment:
name: github-pages
steps:
- uses: actions/deploy-pages@v5