Update README.md #59
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 docs | |
on: | |
push: | |
branches: | |
- "master" | |
jobs: | |
build: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
lfs: true | |
- name: Install elan | |
run: curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y | |
- name: Get cache | |
run: ~/.elan/bin/lake exe cache get || true | |
- name: Build project | |
run: ~/.elan/bin/lake build ModuleLocalProperties | |
- name: Cache mathlib docs | |
uses: actions/cache@v4 | |
with: | |
path: | | |
.lake/build/doc/Init | |
.lake/build/doc/Lake | |
.lake/build/doc/Lean | |
.lake/build/doc/Std | |
.lake/build/doc/Mathlib | |
.lake/build/doc/declarations | |
!.lake/build/doc/declarations/declaration-data-ModuleLocalProperties* | |
key: MathlibDoc-${{ hashFiles('lake-manifest.json') }} | |
restore-keys: | | |
MathlibDoc- | |
- name: Build documentation | |
run: ~/.elan/bin/lake -R -Kenv=dev build ModuleLocalProperties:docs | |
- name: Fix permissions | |
run: | | |
chmod -c -R +rX "./.lake/build/doc/" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./.lake/build/doc/ | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |