mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-26 07:29:59 -07:00
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
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
# 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
|