mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-26 07:29:59 -07:00
docs: publish mdbook in doc to github pages
This commit adds an mdbook for rayhunter documentation in `doc`, and actions workflows to publish that documentation to github pages. This commit configures actions to publish to pages via artifact uploads, but but can be adjusted to publish based solely on a branch.[0] This was chosen to allow for future flexibility in generating multiple outputs (such as a single page html document or pdf). [0] https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site
This commit is contained in:
committed by
Will Greenberg
parent
d31bf45f95
commit
a9f1284fa6
47
.github/workflows/mdbook.yaml
vendored
Normal file
47
.github/workflows/mdbook.yaml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
# On Repository Settings > Pages > Build and deployment
|
||||
# Set "Source" to GitHub Actions.
|
||||
name: Documentation
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
|
||||
jobs:
|
||||
mdbook_test:
|
||||
name: Test mdBook Documentation builds
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install mdBook
|
||||
run: |
|
||||
cargo install mdbook --no-default-features --features search --vers "^0.4" --locked
|
||||
- name: Test mdBook
|
||||
run: mdbook test
|
||||
|
||||
mdbook_publish:
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
needs: mdbook_test
|
||||
permissions:
|
||||
pages: write
|
||||
contents: write
|
||||
id-token: write
|
||||
name: Publish mdBook to Github Pages
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install mdBook
|
||||
run: |
|
||||
cargo install mdbook --no-default-features --features search --vers "^0.4" --locked
|
||||
|
||||
- name: Build mdBook
|
||||
run: mdbook build
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v4
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: book
|
||||
- name: Deploy to Github Pages
|
||||
uses: actions/deploy-pages@v4
|
||||
Reference in New Issue
Block a user