Build and Deploy Docs #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Workflow that deploys project documentation to GitHub Pages | |
name: Build and Deploy Docs | |
on: | |
# Runs on pushes targeting the default branch | |
# push: | |
# branches: | |
# - main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# 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: | |
permissions: | |
contents: write # to write documentation files to the repo | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 | |
- name: Set up Node.js | |
uses: actions/setup-node@5ef044f9d09786428e6e895be6be17937becee3a #v4.0.0 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
cache: 'npm' | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Build all workspace packages | |
run: npm run build | |
- name: TBDocs Reporter | |
id: tbdocs-reporter-protocol | |
uses: TBD54566975/tbdocs@main | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fail_on_error: true | |
group_docs: true | |
entry_points: | | |
- file: packages/api/src/index.ts | |
docsReporter: typedoc | |
docsGenerator: typedoc-html | |
readmeFile: packages/api/README.md | |
- file: packages/crypto/src/index.ts | |
docsReporter: typedoc | |
docsGenerator: typedoc-html | |
readmeFile: packages/crypto/README.md | |
- file: packages/crypto-aws-kms/src/index.ts | |
docsReporter: typedoc | |
docsGenerator: typedoc-html | |
readmeFile: packages/crypto-aws-kms/README.md | |
- name: Upload documentation artifacts | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3 | |
with: | |
name: tbdocs-output | |
path: ./.tbdocs | |
deploy: | |
# Add a dependency to the build job | |
needs: build | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
contents: read # to read from project repo | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Download TBDocs Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: tbdocs-output | |
path: ./tbdocs | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: "./.tbdocs/docs" | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |