Fix :::tip and :::info sidebars. #30
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 to GitHub Pages | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-output | |
path: build/ | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
contents: write | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-output | |
path: build/ | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/master' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# Build output to publish to the `gh-pages` branch: | |
publish_dir: ./build | |
user_name: jwalton | |
user_email: dev@lucid.thedreaming.org | |
pdf: | |
name: Generate PDF Version | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-output | |
path: build/ | |
- name: Install Prince (HTML to PDF converter) | |
run: | | |
curl https://www.princexml.com/download/prince-14.2-linux-generic-x86_64.tar.gz -O | |
tar zxf prince-14.2-linux-generic-x86_64.tar.gz | |
cd prince-14.2-linux-generic-x86_64 | |
yes "" | sudo ./install.sh | |
- name: Start Server and Build PDF | |
run: | | |
# Symlink to make docusaurus `baseUrl` working | |
ln -s ./build rust-book-abridged | |
# Start local server and wait for it to be ready | |
npx serve . -p 1337 & npx wait-on http://localhost:1337/rust-book-abridged | |
# Generate PDF | |
npx docusaurus-prince-pdf -u http://localhost:1337/rust-book-abridged --output rust-book-abridged.pdf | |
# Kill server | |
fuser -k 1337/tcp | |
- name: Upload PDF Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: rust-book-abridged.pdf | |
path: rust-book-abridged.pdf | |
if-no-files-found: error |