Skip to content

Commit

Permalink
modify deploy workflows using mdgen
Browse files Browse the repository at this point in the history
  • Loading branch information
Seasawher committed Jan 11, 2024
1 parent c753cff commit 10216e3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 28 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: install elan
run: |
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain $(cat lean-toolchain)
echo "$HOME/.elan/bin" >> $GITHUB_PATH
- name: build markdown files by mdgen
run: lake run build

- name: Install Dependencies
run: sudo apt update && sudo apt install -y pandoc texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-luatex fonts-dejavu python3-pygments

Expand Down
28 changes: 5 additions & 23 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ concurrency:
cancel-in-progress: false

jobs:
build_md:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
Expand All @@ -33,43 +33,25 @@ jobs:
- name: build markdown files by mdgen
run: lake run build

mdbook_build:
runs-on: ubuntu-latest
needs: build_md
steps:
- name: setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.4.32'

- name: install typst cli
run: cargo install --git https://github.com/typst/typst typst-cli

- name: install mdbook-typst
run: cargo install mdbook-typst

- name: build typst file and html from markdown files
- name: build html from markdown
run: mdbook build

- name: build pdf from typst file
run: typst compile --format pdf book/typst/book.typ

- name: upload artifact (html)
uses: actions/upload-pages-artifact@v2
with:
path: ./book/html

- name: upload artifact (pdf)
- name: upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./book/typst/book.pdf
path: ./book

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: mdbook_build
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
6 changes: 1 addition & 5 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ multilingual = false
src = "md"
title = "Metaprogramming in Lean 4"

[output.html]

[output.typst.output]
format = "typst"
name = "book.typ"
[output.html]

0 comments on commit 10216e3

Please sign in to comment.