File tree 2 files changed +61
-1
lines changed
2 files changed +61
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : ' Preview Deployment'
2
+ on :
3
+ pull_request_target :
4
+ branches :
5
+ - master
6
+
7
+ jobs :
8
+ deploy :
9
+ permissions :
10
+ actions : read
11
+ contents : read
12
+ deployments : write
13
+ pull-requests : write
14
+ runs-on : ubuntu-latest
15
+ timeout-minutes : 5
16
+ steps :
17
+ - name : Checkout code
18
+ uses : actions/checkout@v4
19
+
20
+ - name : Cache node_modules
21
+ uses : actions/cache@v4
22
+ with :
23
+ path : node_modules/
24
+ key : node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
25
+
26
+ - name : Setup node
27
+ uses : actions/setup-node@v4
28
+ with :
29
+ node-version : 18
30
+ cache : npm
31
+ cache-dependency-path : ./package-lock.json
32
+
33
+ - name : Install dependencies
34
+ run : npm ci
35
+
36
+ - name : Build package
37
+ id : build-package
38
+ run : npm run build
39
+ env :
40
+ BASE_PATH : /
41
+ URL : https://betaflight.com
42
+ ORG : betaflight
43
+
44
+ - name : Deploy to Cloudflare
45
+ id : deploy
46
+ uses : cloudflare/wrangler-action@v3
47
+ with :
48
+ apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
49
+ accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
50
+ command : pages deploy build --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --branch ${{ github.head_ref }} --commit-dirty=true
51
+
52
+ - name : Add deployment comment
53
+ uses : thollander/actions-comment-pull-request@v3
54
+ with :
55
+ message : |
56
+ Preview URL: ${{ steps.deploy.outputs.deployment-url }}
57
+ reactions : eyes, rocket
58
+ comment-tag : ' Preview URL'
59
+ mode : recreate
Original file line number Diff line number Diff line change 13
13
- name : Checkout code
14
14
uses : actions/checkout@v4
15
15
16
- - uses : actions/setup-node@v4
16
+ - name : Setup node
17
+ uses : actions/setup-node@v4
17
18
with :
18
19
node-version : 18
19
20
cache : npm
You can’t perform that action at this time.
0 commit comments