Skip to content

Bump actions/cache from 4 to 5 (#4) #60

Bump actions/cache from 4 to 5 (#4)

Bump actions/cache from 4 to 5 (#4) #60

Workflow file for this run

on:
push:
branches:
- master
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
build_project:
runs-on: ubuntu-latest
name: Build project
steps:
- name: Checkout project
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install elan
run: curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain none
- name: Get cache
run: ~/.elan/bin/lake -Kenv=dev exe cache get || true
- name: Build project
run: ~/.elan/bin/lake -Kenv=dev build LeanCourse
- name: Cache mathlib documentation
uses: actions/cache@v5
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/find
.lake/build/doc/*.*
!.lake/build/doc/declarations/declaration-data-LeanCourse*
key: MathlibDoc-${{ hashFiles('lake-manifest.json') }}
restore-keys: MathlibDoc-
- name: Build project documentation
run: ~/.elan/bin/lake -Kenv=dev build LeanCourse:docs
- name: Copy documentation to `docs/docs`
run: |
sudo chown -R runner docs
cp -r .lake/build/doc docs/docs
- name: Remove lake files from documentation in `docs/docs`
run: |
find docs/docs -name "*.trace" -delete
find docs/docs -name "*.hash" -delete
- name: Bundle dependencies
uses: ruby/setup-ruby@v1
with:
working-directory: docs
ruby-version: "3.0"
bundler-cache: true
- name: Bundle website
working-directory: docs
run: JEKYLL_ENV=production bundle exec jekyll build
# - name: Upload docs to `docs/`
# uses: actions/upload-pages-artifact@v4
# with:
# path: docs/
- name: Upload docs & blueprint artifact to `docs/_site`
uses: actions/upload-pages-artifact@v4
with:
path: docs/_site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
# - name: Make sure the cache works
# run: mv docs/docs .lake/build/doc