Skip to content

Build and Deploy to GitHub Pages #3

Build and Deploy to GitHub Pages

Build and Deploy to GitHub Pages #3

Workflow file for this run

name: Build and Deploy to GitHub Pages
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container:
image: archlinux:latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Dependencies
run: |
pacman -Syu --noconfirm
pacman -S --noconfirm rustup jq curl git tar gzip
- name: Setup Rust
run: |
rustup install stable
rustup default stable
- name: Download and setup mdBook
run: |
LATEST_RELEASE=$(curl -s https://api.github.com/repos/rust-lang/mdBook/releases/latest | jq -r ".tag_name")
curl -LO "https://github.com/rust-lang/mdBook/releases/download/${LATEST_RELEASE}/mdbook-${LATEST_RELEASE}-x86_64-unknown-linux-gnu.tar.gz"
tar xzf mdbook-${LATEST_RELEASE}-x86_64-unknown-linux-gnu.tar.gz -C /usr/local/bin
- name: Build mdBook
run: |
mdbook build docs
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_PAT }}
publish_dir: ./book