-
Notifications
You must be signed in to change notification settings - Fork 679
57 lines (49 loc) · 1.55 KB
/
Copy pathsite.yml
File metadata and controls
57 lines (49 loc) · 1.55 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Site
on:
workflow_dispatch:
push:
branches:
- main
- next
paths:
- ".github/workflows/site.yml"
- "apps/site/**"
- "docs/**"
- "packages/**"
- "package-lock.json"
- "package.json"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Build site
run: npm run site:build
- name: Ensure Cloudflare Pages production branch
run: |
curl --fail --silent --show-error --request PATCH \
"https://api.cloudflare.com/client/v4/accounts/${{ secrets.CLOUDFLARE_ACCOUNT_ID }}/pages/projects/chartkit-io" \
--header "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \
--header "Content-Type: application/json" \
--data '{"production_branch":"main"}' \
--output /dev/null
- name: Deploy to Cloudflare Pages
id: cloudflare-pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
wranglerVersion: "4"
command: pages deploy apps/site/dist --project-name=chartkit-io --branch=${{ github.ref_name }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}