-
Notifications
You must be signed in to change notification settings - Fork 57
55 lines (50 loc) · 1.46 KB
/
ci.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
name: Cloudflare Preview
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
# - uses: actions/checkout@v4
# - uses: pnpm/action-setup@v2
# with:
# version: 8.14.1
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
wranglerVersion: "* -w"
packageManager: pnpm # you can omit this if you use npm
workingDirectory: "packages/backend"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
preCommands: pnpm build
command: pages deploy dist --project-name=stackblitz-cr
- name: Deployment Url
env:
DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }}
run: echo $DEPLOYMENT_URL
cr:
runs-on: ubuntu-latest
needs: deploy
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- run: pnpm install
- run: pnpm build
env:
API_URL: ${{ steps.deploy.outputs.deployment-url }}
- name: Stackblitz CR
run: pnpm sb publish
working-directory: ./playground
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}