-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.46 KB
/
deploy.yaml
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: Deploy React App and Worker to Cloudflare
on:
push:
branches:
- main
paths:
- frontstage/**
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18.17.0"
- name: Install dependencies
run: npm install
working-directory: ./frontstage
- name: Build the project
run: npm run build
working-directory: ./frontstage # Corrected syntax
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: taiwan-public-art-information
directory: ./.next
command: pages deploy ./frontstage/.next/static --project-name=taiwan-public-art-information --commit-dirty=true
quiet: false
deploy_worker:
runs-on: ubuntu-latest
needs: build_and_deploy
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Deploy Worker to Cloudflare
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: wrangler publish
env:
CF_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}