2022-03-02 15:19:16 +01:00

42 lines
1.2 KiB
YAML

name: Documentation
env:
CARGO_TERM_COLOR: always
on:
push:
branches: [main, next]
pull_request:
branches: [main, next]
jobs:
build-deploy:
name: Build & Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install nightly rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
# Needed for use of unstable options
toolchain: nightly
override: true
- uses: Swatinem/rust-cache@v1
- name: Build docs
uses: actions-rs/cargo@v1
env:
RUSTDOCFLAGS: "--enable-index-page -Zunstable-options --cfg docsrs"
with:
command: doc
args: --no-deps --workspace --exclude ruma-macros --exclude ruma-identifiers-validation --exclude xtask --all-features -Zrustdoc-map
- name: Deploy to docs branch
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
folder: target/doc
repository-name: ruma/docs.ruma.io
branch: main
ssh-key: ${{ secrets.DOCS_DEPLOY_KEY }}