Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Publish rustdocs to github pages #562

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish Rust Docs

on:
push:
branches:
- master

jobs:
deploy-docs:
name: Deploy docs
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/actions/checkout@v2.3.4

- name: Rust show versions
run: rustup show

- name: Rust cache
uses: Swatinem/rust-cache@v1

- name: Build rustdocs
uses: actions-rs/cargo@v1
with:
command: doc
args: --all --no-deps

# Make an index.html file that redirects to the cumulus-client-collator page
# Copied from https://github.com/substrate-developer-hub/rustdocs/blob/master/index.html
- name: Make index.html
run: echo "<meta http-equiv=refresh content=0;url=cumulus_client_collator/index.html>" > ./target/doc/index.html

- name: Deploy documentation
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./target/doc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if ./target/doc is correct, but let's try. GitHub has no other choice but ./root/ or ./docs and the Action's doc (which should be compatible) says it should be ./public.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the directory where cargo doc builds the docs to. ./public is an example.