/ faang-playbook / .github / workflows / deploy-cloudflare.yml
swadhinbiswas feat: add Cloudflare Pages deployment · 2/2/2026
8931c43
41 lines · 996 Bytes
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
name: Deploy to Cloudflare Pages

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      deployments: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Setup Bun
        uses: oven-sh/setup-bun@v1
        with:
          bun-version: latest

      - name: Install dependencies
        run: cd website && bun install --frozen-lockfile

      - name: Build site
        run: cd website && bun run build

      - name: Deploy to Cloudflare Pages
        uses: cloudflare/pages-action@v1
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
          projectName: faang-playbook
          directory: website/dist
          gitHubToken: ${{ secrets.GITHUB_TOKEN }}
          # Optional: Enable branch deployment
          branch: ${{ github.head_ref || github.ref_name }}