Skip to content

Automate checkpoint generation #9774

Automate checkpoint generation

Automate checkpoint generation #9774

Workflow file for this run

name: Docs
# Cancel workflow if there is a new change to the branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
on:
push:
branches:
- main
merge_group:
pull_request:
branches:
- main
env:
CACHE_TIMEOUT_MINUTES: 5
SCCACHE_ENDPOINT: ${{ vars.SCCACHE_ENDPOINT }}
SCCACHE_BUCKET: ${{ vars.SCCACHE_BUCKET }}
SCCACHE_REGION: ${{ vars.SCCACHE_REGION }}
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
RUSTC_WRAPPER: "sccache"
jobs:
check-publish-docs:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Setup sccache
uses: mozilla-actions/[email protected]
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
- name: Apt Dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 3
command: sudo make install-deps
- name: Link Checker (Repo)
uses: lycheeverse/[email protected]
with:
args: --verbose --no-progress --timeout 60 --max-retries 6 --retry-wait-time 10 --exclude twitter.com 'README.md'
# Fail action on broken links
fail: true
- uses: hanabi1224/[email protected]
- name: Install MDBook
run: make install-doc-tools
env:
RUSTFLAGS: "-Cstrip=symbols"
- name: Execute MDBook
run: make mdbook-build
- name: Build vendored docs
run: make vendored-docs
env:
CC: "sccache clang"
CXX: "sccache clang++"
- name: Link Checker (Docs)
uses: lycheeverse/[email protected]
with:
# Check all docs
args: --verbose --no-progress --timeout 60 --max-retries 6 --retry-wait-time 10 './target/doc/*/index.html'
# Fail action on broken links
fail: true
- name: Prepare rustdoc for publishing
run: mv ./target/doc ./documentation/book/html/rustdoc
# The deploy steps are identical expect for name and 'dry-run' attribute.
# Ideally this would be refactored.
- name: Deploy GH Pages (dry-run)
uses: JamesIves/[email protected]
if: ${{ github.event_name == 'pull_request' }}
with:
branch: gh-pages
folder: ./documentation/book/html/
dry-run: true
- name: Deploy GH Pages
uses: JamesIves/[email protected]
if: ${{ github.event_name == 'push' }}
with:
branch: gh-pages
folder: ./documentation/book/html/
dry-run: false