documentation: github pages action init #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build and deploy documentation" | |
permissions: | |
contents: write | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
build-documentation: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Install Nix" | |
uses: DeterminateSystems/nix-installer-action@v14 | |
- run: | | |
nix -vL build .#docs | |
mkdir -p build | |
mv result build/ | |
- name: "Upload GitHub Pages artifact" | |
uses: actions/upload-pages-artifact@v3.0.1 | |
with: | |
path: "./build" | |
publish-documentation: | |
runs-on: ubuntu-latest | |
needs: build-documentation | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: "github-pages" | |
url: "${{ steps.deployment.outputs.page_url }}" | |
steps: | |
- name: "Deploy to GitHub Pages" | |
id: deployment | |
uses: actions/deploy-pages@v4.0.5 |