Add TOC #3
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: mdBook | |
on: | |
push: | |
branches: | |
- main | |
- rzadp/rfc-book | |
# schedule: | |
# - cron: "0 0 * * *" # Once a day | |
jobs: | |
mdbook: | |
runs-on: ubuntu-latest | |
permissions: | |
# For writing to gh-pages branch. | |
contents: write | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v3 | |
- name: Precreate necessary directories | |
run: | | |
mkdir -p mdbook/src/proposed | |
mkdir -p patches/text | |
- name: Download all proposed RFCs (open PRs) | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const script = require('.github/download-rfc-prs.js') | |
console.log(await script({github, context})) | |
# Create the proposed RFC markdown files from the patches gather in the step above. | |
- run: | | |
# We execute the patches, which results in markdown files created in patches/text/*.md | |
for f in ./patches/text/*.patch; | |
do | |
[ -e "$f" ] || break | |
git apply $f | |
done; | |
cd patches/text/ | |
# We go over the created markdown files and move them for mdbook to pick up. | |
for f in *.md | |
do | |
[ -e "$f" ] || break | |
# We append the contents - because the links to source already exist there at this point. | |
cat $f >> "../../mdbook/src/proposed/$f" | |
done; | |
- name: Setup mdBook binary | |
uses: peaceiris/actions-mdbook@adeb05db28a0c0004681db83893d56c0388ea9ea # v1.2.0 | |
with: | |
mdbook-version: '0.4.36' | |
- name: Install dependencies | |
run: | | |
cargo install [email protected] | |
# This will: | |
# - gather the proposed RFCs (constructed in the steps above). | |
# - gather the approved RFCs (they exist in this repo in text/ directory) | |
# - generate the mdbook out of it | |
- name: Generate the mdbook | |
run: mdbook/book.sh | |
- name: Deploy to github pages | |
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3 | |
with: | |
publish_dir: ./mdbook/book | |
github_token: ${{ secrets.GITHUB_TOKEN }} |