-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: build and deploy doc from Nix to GitHub Pages
- Loading branch information
1 parent
cc332d6
commit 61ba37c
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Documentation | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
doc: | ||
name: Documentation | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Install Nix | ||
uses: cachix/install-nix-action@v25 | ||
- name: Cache Nix derivations | ||
uses: DeterminateSystems/magic-nix-cache-action@v2 | ||
- uses: actions/checkout@v2 | ||
- name: Fetch all git history | ||
run: git fetch --force --prune --tags --unshallow | ||
- name: Build documentation | ||
run: nix build .#workspace.doc | ||
- name: Fix permissions | ||
run: | | ||
chmod -c -R +rX "_site/" | while read line; do | ||
echo "::warning title=Invalid file permissions automatically fixed::$line" | ||
done | ||
- name: Upload Pages artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
doc-deploy: | ||
needs: doc | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action |
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