68 lines
1.5 KiB
YAML
68 lines
1.5 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
name: Documentation
|
|
|
|
jobs:
|
|
deploy-docs:
|
|
concurrency: deploy-docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
|
|
- name: Cache
|
|
uses: Swatinem/rust-cache@v1
|
|
|
|
- name: Clean docs dir
|
|
run: rm -rf docs
|
|
shell: bash
|
|
|
|
- name: Clean Rust docs dir
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: clean
|
|
args: --doc
|
|
|
|
- name: Build Rust docs
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: doc
|
|
args: --workspace --all-features --no-deps
|
|
|
|
- name: Move Rust docs
|
|
run: mkdir -p docs && mv target/doc/* docs/.
|
|
shell: bash
|
|
|
|
- name: Install doxygen
|
|
run: sudo apt-get install -y doxygen
|
|
shell: bash
|
|
|
|
- name: Install cmocka
|
|
run: sudo apt-get install -y libcmocka-dev
|
|
shell: bash
|
|
|
|
- name: Build C docs
|
|
run: ./scripts/ci/cmake-docs
|
|
shell: bash
|
|
|
|
- name: Move C docs
|
|
run: mkdir -p docs/automerge-c && mv automerge-c/build/src/html/* docs/automerge-c/.
|
|
shell: bash
|
|
|
|
- name: Configure root page
|
|
run: echo '<meta http-equiv="refresh" content="0; url=automerge">' > docs/index.html
|
|
|
|
- name: Deploy docs
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./docs
|