⟦lexicon.md⟧: Adding a link to the HTML version. #35
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: Deploy GitHub Pages | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Cache Rust binaries | |
id: cache-rust | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo/bin/* | |
# This key must be changed every time a new Rust binary is added. | |
key: ${{runner.os}}-rust | |
- name: Install mdbook | |
run: | | |
mkdir bins | |
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.18/mdbook-v0.4.18-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./bins | |
echo `pwd`/bins >> $GITHUB_PATH | |
- name: Install mdbook-linkcheck | |
run: | | |
cd ./bins | |
curl -o ./linkcheck.zip -sSL https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v0.7.6/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip | |
unzip linkcheck.zip | |
cd .. | |
- name: Install mdbook-regex-replacer | |
if: steps.cache-rust.outputs.cache-hit != 'true' | |
uses: actions-rs/install@v0.1 | |
with: | |
crate: mdbook-regex-replacer | |
version: latest | |
use-tool-cache: true | |
- name: Build refgram book | |
run: | | |
mdbook build grammar | |
# - name: Install NPM dependencies | |
# run: | | |
# cd node | |
# npm install | |
# cd .. | |
# - name: Build JS bundles | |
# run: | | |
# cd node | |
# npm run build | |
# cd .. | |
- name: Commit changes to gh-pages | |
run: | | |
rm -f .gitignore | |
echo "node_modules" > .gitignore | |
git config user.email "actions@github.com" | |
git config user.name "GitHub Actions" | |
git checkout -b tmp/gh-pages | |
git add -A | |
git commit -m "Update GitHub pages" | |
git push origin tmp/gh-pages:gh-pages --force |