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