feat: allow manual docs generation #3
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: Generate API Documentation | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "backend/**" | |
- ".github/workflows/docs.yaml" | |
workflow_dispatch: | |
jobs: | |
gen_docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: docs | |
- name: Reset Branch | |
run: | | |
git fetch origin | |
git reset --hard 'origin/${{ github.ref_name }}' | |
- name: Generate Rust Docs | |
uses: moonrepo/setup-rust@v1 | |
run: | | |
pushd backend/ | |
cargo doc --no-deps | |
mv target/doc/ ../docs/ | |
popd | |
- uses: EndBug/add-and-commit@v9 # You can change this to use a specific version. | |
with: | |
add: 'docs -f' | |
commit: --signoff | |
message: 'docs: updated API documentation' | |
push: origin docs -f |