Generate docs (#1)

* feat: Reorganize code

* feat: Generate docs as mdbook

* feat: Add deploy github action

* fix: formatting
This commit is contained in:
Jalil David Salamé Messina 2024-01-14 18:58:08 +01:00 committed by GitHub
parent ca6bf00ad6
commit 63034a2af9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 144 additions and 70 deletions

43
.github/workflows/deploy.yaml vendored Normal file
View file

@ -0,0 +1,43 @@
name: Deploy Documentation
on:
push:
branches: [main]
paths:
- ./.github/workflows/deploy.yaml # this workflow
- ./docs/** # Docs generation code
- ./options.nix # module options
# Nix files
- flake.lock
- flake.nix
jobs:
build-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@v9
- uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Build documentation
run: nix build .#docs --print-build-logs
- name: Adjust permissions
run: |
chown -R "$(id -u):$(id -g)" ./result
chmod -R a+rwx ./result
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./result
deploy:
needs: build
runs-on: ubuntu-latest
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@v2