yew/.github/workflows/build-api-docs.yml
Muhammad Hamza 62e3194d5f
Improve hosted API docs (#2373)
* build up redirects for API docs hosting

* build with all features and documenting config

* fix warnings

* can rustdoc please provide a way to modify the base url?

I want to host the docs at /next/:crate_name, not at /:crate_name ffs

* Don't clean URLs... what is rustdoc doing?

* now it wants to work???

* build a next index page

* unreleased docs banner

* show coverage

* remove ./ ???

* try 2?

* api-docs/ not api-docs-public/

* please
2022-01-15 19:57:35 +01:00

63 lines
1.6 KiB
YAML

name: Build API Docs (Rustdoc)
on:
pull_request:
branches: [master]
paths:
- "packages/**"
- "firebase.json"
- ".github/workflows/*-docs.yml"
push:
branches: [master]
paths:
- "packages/**"
- "firebase.json"
- ".github/workflows/*-docs.yml"
jobs:
build:
runs-on: ubuntu-latest
env:
PR_INFO_FILE: ".PR_INFO"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
components: rust-docs
- name: Run cargo doc
uses: actions-rs/cargo@v1
env:
RUSTDOCFLAGS: --cfg documenting --html-before-content ./api-docs/before-content.html --extend-css ./api-docs/styles.css -Z unstable-options --enable-index-page
with:
command: doc
args: -p yew -p yew-macro -p yew-router -p yew-router-macro -p yew-agent --no-deps --all-features
- name: Move files in correct directory
run: |
mkdir -p api-docs/dist/next
cp -r target/doc/* api-docs/dist/next
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: api-docs
path: api-docs/
retention-days: 1
- if: github.event_name == 'pull_request'
name: Build pr info
run: |
echo "${{ github.event.number }}" > $PR_INFO_FILE
- if: github.event_name == 'pull_request'
name: Upload pr info
uses: actions/upload-artifact@v2
with:
name: pr-info
path: "${{ env.PR_INFO_FILE }}"
retention-days: 1