name: Deploy Docs on: push: branches: [main] paths: - 'apps/docs/**' - 'packages/utils/src/openapi/**' # Called by upload-openapi-spec.yml: the API reference is rendered statically # at build time, so a new spec in R2 only reaches the site via a docs rebuild. workflow_call: workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest environment: production steps: - name: Checkout code uses: actions/checkout@v4 # Blume requires Node >= 22.12; the rest of the monorepo is still on 20. - name: Setup Node.js uses: actions/setup-node@v4 with: node-version-file: 'apps/docs/.nvmrc' - name: Setup pnpm uses: pnpm/action-setup@v4 - name: Get pnpm store directory shell: bash run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - name: Setup pnpm cache uses: actions/cache@v4 with: path: ${{ env.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- - name: Install dependencies run: pnpm install --frozen-lockfile # scripts/fetch-openapi.mjs imports @cio/utils/openapi/public-api from dist. - name: Build workspace dependencies run: pnpm turbo run build --filter=@cio/docs^... # Reports broken internal links and heading anchors. Advisory rather than # a gate, because the checker is base-unaware and always reports two known # classes of false positive: links into the /api reference (Scalar's route # is not in the page index) and every image under public/ (it resolves public/ # against the site root, which deployment.base '/docs' moves). Read the log # for anything outside those two. - name: Validate links and anchors run: pnpm --filter @cio/docs validate continue-on-error: true - name: Build docs run: pnpm --filter @cio/docs build - name: Deploy to Cloudflare run: pnpm --filter @cio/docs exec wrangler deploy env: CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}