-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add workflows for publishing to GH Pages (#13)
- Deploy every commit on `main` with relevant changes. - Generate and publish previews for every PR with relevant changes.
- Loading branch information
Showing
6 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Build the mdBook | ||
description: Generate static site from markdown files through mdBook | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Create bin directory and add to $PATH | ||
run: | | ||
mkdir bin | ||
echo "$(pwd)/bin" >> ${GITHUB_PATH} | ||
shell: bash | ||
- name: Install mdbook | ||
run: | | ||
url="https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz" | ||
curl -sSL "$url" | tar -xz --directory=bin | ||
shell: bash | ||
- name: Install mdbook-linkcheck | ||
run: | | ||
url="https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip" | ||
curl -sSL "$url" -o mdbook-linkcheck.zip | ||
unzip "$_" -d bin | ||
chmod +x bin/mdbook-linkcheck | ||
shell: bash | ||
- name: Build the book and check for broken links | ||
run: mdbook build | ||
env: | ||
RUST_LOG: INFO | ||
shell: bash |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Build and deploy GitHub Pages | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- "book.toml" | ||
- "docs/**" | ||
- ".github/actions/build-mdbook/action.yaml" | ||
- ".github/workflows/pages-deploy.yaml" | ||
|
||
concurrency: ci-${{ github.ref }} | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/build-mdbook | ||
- name: Deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
folder: build/html | ||
clean-exclude: pr-preview/ | ||
force: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Build and deploy GitHub Pages preview for PRs | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- closed | ||
paths: | ||
- "book.toml" | ||
- "docs/**" | ||
- ".github/actions/build-mdbook/action.yaml" | ||
- ".github/workflows/pages-preview.yaml" | ||
|
||
|
||
concurrency: preview-${{ github.ref }} | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
preview: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/build-mdbook | ||
if: github.event.action != 'closed' | ||
- name: Deploy preview | ||
uses: rossjrw/[email protected] | ||
with: | ||
source-dir: build/html |
File renamed without changes.
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