/ justapi / .github / workflows / docs-deploy.yml
swadhinbiswas πŸš€ ci: pin wrangler version in docs deploy action Β· 8/8/2026
9eee375
42 lines Β· 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Deploy Docs to Cloudflare Pages

on:
  push:
    branches: [main]
    paths: ['docs_site/**']
  workflow_dispatch:

permissions:
  contents: read

jobs:
  deploy:
    name: Build & Deploy Docs
    runs-on: ubuntu-latest
    # Requires repo secret CLOUDFLARE_API_TOKEN (token with Pages:Edit permission)
    # and CLOUDFLARE_ACCOUNT_ID. Set both in Settings β†’ Secrets β†’ Actions.
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: npm
          cache-dependency-path: docs_site/package-lock.json

      - name: Install dependencies
        working-directory: docs_site
        run: npm ci

      - name: Build
        working-directory: docs_site
        run: npm run build

      - name: Deploy to Cloudflare Pages
        uses: cloudflare/wrangler-action@v3
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
          wranglerVersion: 4.120.0
          command: pages deploy docs_site/dist --project-name=justapi-docs --branch=main