File tree 2 files changed +47
-16
lines changed
2 files changed +47
-16
lines changed Original file line number Diff line number Diff line change 1
- name : " Deploy to Cloudflare Pages ( Preview) "
1
+ name : " Build Preview Deployment "
2
2
3
- on : [pull_request_target]
3
+ on :
4
+ pull_request :
5
+ types : [opened, synchronize]
4
6
5
7
jobs :
6
- deploy :
8
+ build-preview :
7
9
runs-on : " ubuntu-latest"
8
- permissions :
9
- contents : read
10
- deployments : write
11
- pull-requests : write
10
+ name : " Build Preview Site and Upload Build Artifact"
12
11
steps :
13
12
- name : " checkout"
14
13
uses : " actions/checkout@v4"
34
33
run : |
35
34
cp _headers build/
36
35
cp _redirects build/
37
- - name : " publish (push)"
38
- id : " cloudflare-publish"
39
- uses : " AdrianGonz97/refined-cf-pages-action@v1"
36
+ - name : " upload build artifact"
37
+ uses : " actions/upload-artifact@v4"
40
38
with :
41
- apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
42
- accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
43
- projectName : " papermc-docs"
44
- deploymentName : " Preview"
45
- gitHubToken : ${{ secrets.GITHUB_TOKEN }}
46
- directory : " build"
39
+ name : " preview-build"
40
+ path : " build"
Original file line number Diff line number Diff line change
1
+ name : " Publish Preview Deployment"
2
+
3
+ on :
4
+ workflow_run :
5
+ workflows : ["Build Preview Deployment"]
6
+ types :
7
+ - completed
8
+
9
+ permissions :
10
+ actions : read
11
+ contents : read
12
+ deployments : write
13
+ pull-requests : write
14
+
15
+ jobs :
16
+ deploy-preview :
17
+ runs-on : " ubuntu-latest"
18
+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
19
+ name : " Deploy Preview to Cloudflare Pages"
20
+ steps :
21
+ - name : " Download build artifact"
22
+ uses : " actions/download-artifact@v4"
23
+ id : " preview-build-artifact"
24
+ with :
25
+ name : " preview-build"
26
+ path : " build"
27
+ github-token : ${{ secrets.GITHUB_TOKEN }}
28
+ run-id : ${{ github.event.workflow_run.id }}
29
+ - name : " Deploy to Cloudflare Pages"
30
+ uses : " AdrianGonz97/refined-cf-pages-action@v1"
31
+ with :
32
+ apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
33
+ accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
34
+ githubToken : ${{ secrets.GITHUB_TOKEN }}
35
+ projectName : " papermc-docs"
36
+ deploymentName : " Preview"
37
+ directory : ${{ steps.preview-build-artifact.outputs.download-path }}
You can’t perform that action at this time.
0 commit comments