Skip to content

feat: change docs workflow to use official gh actions #171

feat: change docs workflow to use official gh actions

feat: change docs workflow to use official gh actions #171

Workflow file for this run

---
name: "Publish Docs"
on:
push:
branches: ["main"]
paths:
- .github/workflows/publish-docs.yaml
- docs/**
- README.md
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
name: Build Docs
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Generate Token
uses: actions/create-github-app-token@46e4a501e119d39574a54e53a06c9a705efc55c9 # v1.6.1
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
token: "${{ steps.app-token.outputs.token }}"
- name: Setup Pages
id: pages
uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0
with:
token: "${{ steps.app-token.outputs.token }}"
enablement: true
- name: Build docs
uses: docker://ghcr.io/bjw-s/mdbook:0.4.36@sha256:b7bfe9e63b8e8a8d6617c58918ea3e6d08bcc2ad74377c0bd26e75d0e716d2f7
with:
args: mdbook build docs
- name: Upload artifact
uses: actions/upload-pages-artifact@a753861a5debcf57bf8b404356158c8e1e33150c # v2.0.0
with:
path: ./docs/book
publish:
name: Publish Docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Generate Token
uses: actions/create-github-app-token@46e4a501e119d39574a54e53a06c9a705efc55c9 # v1.6.1
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@77d7344265e1f960dab5c00dbff52287a70b0d4f # v3.0.0
with:
token: "${{ steps.app-token.outputs.token }}"
artifact_name: github-pages