-
Notifications
You must be signed in to change notification settings - Fork 183
58 lines (53 loc) · 1.7 KB
/
sdk-playground-production.yml
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
58
name: sdk playground production deploy
on:
push:
branches: [main]
jobs:
build:
environment: production
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: checkout
- uses: pnpm/action-setup@v2
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
# build latest embedded-app-sdk
- name: build latest embedded-app-sdk
run: |
pnpm install && pnpm build
# create env file
- name: create env file
run: |
cd examples/sdk-playground
echo "${{ secrets.ENV_FILE }}" > .env.production
# build sdk playground client
- name: build sdk-playground client
run: |
cd examples/sdk-playground/packages/client
pnpm build
# deploy client
- name: deploy client
uses: cloudflare/wrangler-action@v3.7.0
with:
packageManager: pnpm
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
workingDirectory: examples/sdk-playground/packages/client
command: pages publish --project-name=sdk-playground dist
wranglerVersion: '3.52.0'
# deploy server
- name: deploy server
uses: cloudflare/wrangler-action@v3.7.0
with:
packageManager: pnpm
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
preCommands: ./handle-wrangler-secrets.sh production remote
workingDirectory: examples/sdk-playground/packages/server
command: publish src/index.ts --env production
wranglerVersion: '3.52.0'