diff --git a/.github/workflows/rustdoc.yaml b/.github/workflows/rustdoc.yaml new file mode 100644 index 0000000000..982d69e75a --- /dev/null +++ b/.github/workflows/rustdoc.yaml @@ -0,0 +1,36 @@ +name: rustdoc +on: + pull_request: + types: [closed] + branches: + - master + +jobs: + rustdoc: + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install & display rust toolchain + run: rustup show + + - name: Check targets are installed correctly + run: rustup target list --installed + + - name: Build Documentation + run: cargo doc --no-deps + + - name: Push index.html + run: echo "" > ./target/doc/index.html + + - name: Push CNAME + run: echo "crates.astar.network" > ./target/doc/CNAME + + - name: Deploy Docs + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: ./target/doc