Skip to content

Commit

Permalink
Publish rustdocs to github pages (paritytech#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshOrndorff authored Mar 15, 2021
1 parent 557dcaa commit 444c9ff
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish Rust Docs

on:
push:
branches:
- master

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

steps:
- name: Checkout repository
uses: actions/checkout@v1

- uses: actions-rs/toolchain@v1
with:
target: wasm32-unknown-unknown
# Toolchain is autodetected from `rust-toolchain` file
# https://github.com/actions-rs/toolchain#the-toolchain-file
#toolchain: ${{ env.WASM_BUILD_TOOLCHAIN }}
default: true

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-doc-${{ hashFiles('**/Cargo.lock') }}

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

# Make an index.html file so we start at the moonbeam_runtime 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=moonbeam_runtime/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

0 comments on commit 444c9ff

Please sign in to comment.