Skip to content

Commit

Permalink
Merge pull request #285 from RaitoBezarius/aeneas-docs
Browse files Browse the repository at this point in the history
doc: initialize a user-facing mdbook
  • Loading branch information
Nadrieril authored Jul 10, 2024
2 parents 589339b + 250ec9a commit 9e6f559
Show file tree
Hide file tree
Showing 11 changed files with 448 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build-userdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Build Aeneas user docs and test them
on: [push, pull_request]

jobs:
test:
name: Test Aeneas user docs
runs-on: [self-hosted, linux, nix]
steps:
- uses: actions/checkout@v4
- name: Build the book
run: nix build '.?dir=docs/user'#book
# TODO: test the Lean examples code via nix build '.?dir=docs/user'#test or something similar.
32 changes: 32 additions & 0 deletions .github/workflows/deploy-userdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy Aeneas user docs to GitHub pages
on:
push:
branches:
- main

jobs:
deploy:
runs-on: [self-hosted, linux, nix]
permissions:
contents: write # To push a branch
pull-requests: write # To create a PR from that branch
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Deploy GitHub Pages
run: |
# This assumes your book is in the root of your repository.
# Just add a `cd` here if you need to change to another directory.
nix build '.?dir=docs/user'#book -o html
git worktree add gh-pages
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
# Delete the ref to avoid keeping history.
git update-ref -d refs/heads/gh-pages
rm -rf *
cp --dereference -vr ../html/* .
git add .
git commit -m "Deploy $GITHUB_SHA to gh-pages"
git push --force --set-upstream origin gh-pages
1 change: 1 addition & 0 deletions docs/user/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
1 change: 1 addition & 0 deletions docs/user/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
book
6 changes: 6 additions & 0 deletions docs/user/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[book]
authors = ["The Aeneas contributors"]
language = "en"
multilingual = false
src = "src"
title = "Aeneas user documentation"
256 changes: 256 additions & 0 deletions docs/user/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9e6f559

Please sign in to comment.