Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
rm elan-init.sh
echo "$HOME/.elan/bin" >> $GITHUB_PATH

# このステップは lake run build_html を実行するために必要
- name: Setup Node.js
uses: actions/setup-node@v7
with:
Expand All @@ -44,11 +45,6 @@ jobs:
- name: build markdown and HTML files
run: lake run build_html

- name: Run Link Checker
uses: lycheeverse/lychee-action@v2
with:
args: "./booksrc/**/*.md"

- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/link_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Link Check

on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "link-check"
cancel-in-progress: false

jobs:
link_check:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Install elan
run: |
curl -O --location https://elan.lean-lang.org/elan-init.sh
sh elan-init.sh -y --default-toolchain stable
rm elan-init.sh
echo "$HOME/.elan/bin" >> $GITHUB_PATH

- name: build markdown files
run: lake run build_md

- name: Run Link Checker
uses: lycheeverse/lychee-action@v2
with:
args: "./booksrc/**/*.md"
7 changes: 6 additions & 1 deletion lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ def runCmd
else if !out.stdout.isEmpty then
IO.println out.stdout.trimAscii.copy

/-- markdown ファイルを生成する -/
script build_md do
runCmd "lake exe mdgen LeanByExample booksrc --count --copy"
return 0

/-- mdgen と mdbook を順に実行し、
Lean ファイルから Markdown ファイルと HTML ファイルを生成する。-/
script build_html do
Expand All @@ -64,7 +69,7 @@ script build_html do
runCmd "node scripts/updateSeoMetadata.mjs"
return 0

/-- `lake run build_pdf` で PDF を生成する -/
/-- PDF を生成する -/
script build_pdf do
runCmd s!"lake exe mdgen LeanByExample booksrc --count --copy"
let outputConfig ← IO.FS.readFile "typst/pdf-output.json"
Expand Down
Loading