48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
# Build and deploy MkDocs to gh-pages for main branch
|
|
name: gh-pages
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- staging
|
|
- trying
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: cachix/install-nix-action@v25
|
|
- uses: cachix/cachix-action@v14
|
|
with:
|
|
name: numtide
|
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
- name: Build the docs
|
|
id: build
|
|
run: |
|
|
nix build .#docs
|
|
echo "result=$(readlink ./result)" >> $GITHUB_OUTPUT
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
if: github.ref == 'refs/heads/main'
|
|
with:
|
|
path: result
|
|
|
|
# Deployment job
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
name: Deploy
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|