ci: try upload-pages-artifact #13
Workflow file for this run
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
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
- released | |
name: "Build and check HTML" | |
jobs: | |
build: | |
name: Build site and generate HTML | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install deps for figures (OS packages) | |
run: | | |
sudo apt update && sudo apt install -y poppler-utils | |
- name: Install deps for figures (TeX) | |
uses: teatimeguest/setup-texlive-action@v3 | |
with: | |
packages: | | |
scheme-minimal | |
latex-bin | |
fontspec | |
standalone | |
pgf | |
pdftexcmds | |
luatex85 | |
infwarerr | |
ltxcmds | |
xcolor | |
fontawesome | |
spath3 | |
inter | |
epstopdf-pkg | |
tex-gyre | |
sourcecodepro | |
- name: Install elan | |
run: | | |
set -o pipefail | |
curl -sSfL https://github.com/leanprover/elan/releases/download/v3.0.0/elan-x86_64-unknown-linux-gnu.tar.gz | tar xz | |
./elan-init -y --default-toolchain none | |
echo "$HOME/.elan/bin" >> "$GITHUB_PATH" | |
- uses: actions/checkout@v4 | |
- name: Lean Version | |
run: | | |
lean --version | |
- name: Cache .lake | |
uses: actions/cache/restore@v4 | |
with: | |
path: .lake | |
key: ${{ runner.os }}-${{ hashFiles('lean-toolchain') }}-${{ hashFiles('lake-manifest.json') }}-${{ hashFiles('lakefile.lean') }}-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-${{ hashFiles('lean-toolchain') }}-${{ hashFiles('lake-manifest.json') }}-${{ hashFiles('lakefile.lean') }}-${{ github.sha }} | |
${{ runner.os }}-${{ hashFiles('lean-toolchain') }}-${{ hashFiles('lake-manifest.json') }}-${{ hashFiles('lakefile.lean') }} | |
${{ runner.os }}-${{ hashFiles('lean-toolchain') }}-${{ hashFiles('lake-manifest.json') }}- | |
${{ runner.os }}-${{ hashFiles('lean-toolchain') }}- | |
- name: Build | |
run: | | |
lake exe cache get | |
lake build | |
- name: Save cache for .lake | |
uses: actions/cache/save@v4 | |
with: | |
path: .lake | |
key: ${{ runner.os }}-${{ hashFiles('lean-toolchain') }}-${{ hashFiles('lake-manifest.json') }}-${{ hashFiles('lakefile.lean') }}-${{ github.sha }} | |
- name: Generate HTML | |
run: | | |
lake --quiet exe generate-manual --depth 2 --with-word-count "words.txt" --verbose --output "_out" --site-base-url "/" | |
- name: Upload static files as artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: '_out/' | |
- name: Report word count | |
run: | | |
echo "Word Counts" | |
echo "-----------" | |
cat words.txt | |
- name: Save word count | |
run: | | |
echo "# Word Counts" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
cat words.txt >> $GITHUB_STEP_SUMMARY | |
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
# Deploy job | |
deploy: | |
# only deploy on main | |
if: github.ref == 'refs/heads/main' | |
# Add a dependency to the build job | |
needs: build | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
# Specify runner + deployment step | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |