Skip to content

Merge pull request #6 from no-witness-labs/fix/deploy-docs-2 #9

Merge pull request #6 from no-witness-labs/fix/deploy-docs-2

Merge pull request #6 from no-witness-labs/fix/deploy-docs-2 #9

Workflow file for this run

name: Deploy Documentation
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# 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 job
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- id: cached-build-artifacts
uses: actions/cache@v4
with:
path: packages/*/dist
key: build-artifacts-${{ github.sha }}
- id: cache-node-modules
uses: actions/cache@v4
with:
path: |
node_modules
packages/*/node_modules
docs/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-modules-
- id: cache-turbo
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
# Always run install to ensure all dependencies are available
# This ensures workspace packages like docs have their dependencies
- run: pnpm install --frozen-lockfile
- run: pnpm turbo run build
if: steps.cached-build-artifacts.outputs.cache-hit != 'true'
- run: pnpm turbo run docgen --filter=@evolution-sdk/evolution
- run: pnpm turbo run build --filter=@evolution-sdk/docs
- id: cache-docs-output
uses: actions/cache@v4
with:
path: docs/out
key: docs-output-${{ github.sha }}
restore-keys: |
docs-output-
- uses: actions/upload-pages-artifact@v3
with:
path: docs/out
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- id: deployment
uses: actions/deploy-pages@v4