File tree Expand file tree Collapse file tree 1 file changed +29
-7
lines changed Expand file tree Collapse file tree 1 file changed +29
-7
lines changed Original file line number Diff line number Diff line change 11name : ' Preview Deployment'
22on :
33 pull_request_target :
4+ types : [opened, synchronize, reopened]
45 branches :
56 - master
67
78jobs :
8- deploy :
9- permissions :
10- actions : read
11- contents : read
12- deployments : write
13- pull-requests : write
9+ # Job 1: Build the code (no secrets here)
10+ build :
1411 runs-on : ubuntu-latest
15- timeout-minutes : 5
1612 steps :
1713 - name : Checkout code
1814 uses : actions/checkout@v4
15+ with :
16+ ref : ${{ github.event.pull_request.head.sha }}
17+ persist-credentials : false # Don't persist GitHub token
1918
2019 - name : Cache node_modules
2120 uses : actions/cache@v4
3231 - run : yarn install
3332 - run : yarn build
3433
34+ - name : Upload build artifact
35+ uses : actions/upload-artifact@v4
36+ with :
37+ name : dist-files
38+ path : src/dist
39+
40+ # Job 2: Deploy with secrets (no PR code checkout)
41+ deploy :
42+ needs : build # Wait for build job to complete
43+ permissions :
44+ actions : read
45+ contents : read
46+ deployments : write
47+ issues : write
48+ pull-requests : write
49+ runs-on : ubuntu-latest
50+ steps :
51+ - name : Download build artifact
52+ uses : actions/download-artifact@v4
53+ with :
54+ name : dist-files
55+ path : src/dist
56+
3557 - name : Deploy to Cloudflare
3658 id : deploy
3759 uses : cloudflare/wrangler-action@v3
You can’t perform that action at this time.
0 commit comments