Skip to content

Create build_and_publish_docs.yaml #1

Create build_and_publish_docs.yaml

Create build_and_publish_docs.yaml #1

name: Build and Publish Docs
on:
pull_request:
push:
branches: [ 'main' ]
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: cargo doc
run: cargo doc
- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: bc-rust-docs
path: ./target/doc/
publish_to_gh_pages:
needs: build_docs
if: github.ref == 'refs/heads/master'
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Update git pages with new compatibiliy matrix
id: deployment
uses: actions/deploy-pages@v4