From 883d1f5d3ecb26a97dab7a08400fede53059ea62 Mon Sep 17 00:00:00 2001 From: lklimek <842586+lklimek@users.noreply.github.com> Date: Tue, 26 Mar 2024 08:14:26 +0100 Subject: [PATCH] build: deploy docs site on github pages (#58) * build: deploy docs site on github pages * chore: gh pages only on push to master --- .github/workflows/github-pages.yml | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/github-pages.yml diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml new file mode 100644 index 0000000..e3ad682 --- /dev/null +++ b/.github/workflows/github-pages.yml @@ -0,0 +1,57 @@ +--- +name: Github Pages + +on: + push: + branches: + - master + - "build/docs-website" # TODO remove after it's merged +jobs: + cleanup-runs: + runs-on: ubuntu-latest + steps: + - uses: rokroskar/workflow-run-cleanup-action@master + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'" + + gh-pages: + # environment: + # name: github-pages + # url: ${{ steps.deployment.outputs.page_url }} + permissions: + contents: read + pages: write + id-token: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: ./.github/actions/deps + + - name: Setup Pages + uses: actions/configure-pages@v3 + + - name: Generate documentation + shell: bash + env: + RUSTDOCFLAGS: "--cfg docsrs" + run: cargo doc --no-deps --all-features --workspace --exclude tenderdash-proto-compiler + + - name: Generate index page + shell: bash + run: | + cat > target/doc/index.html << EOF +
+ Click here + + EOF + + - name: Upload docs + uses: actions/upload-pages-artifact@v1 + with: + path: "target/doc" + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1