Skip to content

Commit

Permalink
Try out GHA for Pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
gpmayorga committed Nov 20, 2023
1 parent ce018cb commit 1372329
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,17 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
docs:
build-docs:
permissions:
contents: write
id-token: write
contents: read
runs-on: ubuntu-latest-4-cores
env:
RUSTDOCFLAGS: "-D warnings"
RUSTC_WRAPPER: "sccache"
steps:
- name: Checkout repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4

- name: Prep build on Ubuntu
uses: ./.github/actions/prep-ubuntu
with:
RUST_TOOLCHAIN: ${{ env.RUST_TOOLCHAIN }}
cache: enabled
# Cache needs Google credentials:
GWIP: ${{ secrets.GWIP_SCCACHE }}
Expand All @@ -31,7 +26,9 @@ jobs:
- name: Build documentation
id: build_docs
run: cargo doc --all --no-deps

env:
RUSTDOCFLAGS: "-D warnings"
RUSTC_WRAPPER: "sccache"

- name: Build Documentation failed
if: always() && steps.build_docs.outcome == 'failure'
Expand All @@ -43,12 +40,22 @@ jobs:
run: |
echo "<meta http-equiv=\"refresh\" content=\"0; url=centrifuge_chain/index.html\">" \ > ./target/doc/index.html
- name: upload Docs files
uses: actions/upload-pages-artifact@v2
with:
path: ./target/doc

deploy-docs:
runs-on: ubuntu-latest
permissions:
pages: write # to deploy to Pages
id-token: write
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # 3.9.3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./target/doc
cname: reference.centrifuge.io
force_orphan: true
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit 1372329

Please sign in to comment.