forked from cerc-io/snowballtools-base
Bump node v in docs workflow fix(docs): treat warnings as errors false fix(docs)Correct docs pattern in gitignore Add target branch to docs build fix(docs)Correct docs pattern in gitignore Add target branch to docs build Add target branch to docs build
41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
name: Generate and Deploy Docs
|
|
|
|
on:
|
|
workflow_dispatch: # Allow manual triggering
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # Fetch all history for proper branch detection
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
cache: 'yarn'
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Update TypeDoc config for current branch
|
|
run: |
|
|
CURRENT_BRANCH=${GITHUB_REF#refs/heads/}
|
|
echo "Current branch: $CURRENT_BRANCH"
|
|
# Update gitRevision in typedoc.json to use the current branch
|
|
sed -i "s|\"gitRevision\": \"qrigin/[^\"]*\"|\"gitRevision\": \"qrigin/$CURRENT_BRANCH\"|" typedoc.mjs
|
|
|
|
- name: Generate documentation
|
|
run: yarn typedoc
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: JamesIves/github-pages-deploy-action@v4
|
|
with:
|
|
folder: docs
|
|
clean: true
|
|
token: ${{ secrets.ACTIONS_ONLY }} # Use the ACTION_ONLY token
|