From 7978b18613304a50295e95c4f61089bee223f2ac Mon Sep 17 00:00:00 2001
From: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>
Date: Mon, 9 Aug 2021 11:00:32 -0400
Subject: [PATCH] Publish rustdocs to github pages (#562)

* Publish rustdocs to github pages

* @TriplEight 's suggestions from code review

Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>

Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
---
 cumulus/.github/workflows/docs.yml | 39 ++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 cumulus/.github/workflows/docs.yml

diff --git a/cumulus/.github/workflows/docs.yml b/cumulus/.github/workflows/docs.yml
new file mode 100644
index 00000000000..91baeff7275
--- /dev/null
+++ b/cumulus/.github/workflows/docs.yml
@@ -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
-- 
GitLab