Skip to content

Commit 00e860d

Browse files
committed
ci: fix fork preview
1 parent 2acdec3 commit 00e860d

File tree

2 files changed

+41
-7
lines changed

2 files changed

+41
-7
lines changed
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ jobs:
3636
- name: Build Quartz
3737
run: npx quartz build -d docs -v
3838

39-
- name: Publish to Cloudflare Pages
40-
uses: AdrianGonz97/refined-cf-pages-action@v1
39+
- name: Upload build artifact
40+
uses: actions/upload-artifact@v4
4141
with:
42-
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
43-
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
44-
githubToken: ${{ secrets.GITHUB_TOKEN }}
45-
projectName: quartz
46-
directory: public
42+
name: preview-build
43+
path: public
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Upload Preview Deployment
2+
on:
3+
workflow_run:
4+
workflows: ["Build Preview Deployment"]
5+
types:
6+
- completed
7+
8+
permissions:
9+
actions: read
10+
deployments: write
11+
contents: read
12+
pull-requests: write
13+
14+
jobs:
15+
deploy-preview:
16+
if: ${{ github.repository == 'jackyzha0/quartz' && github.event.workflow_run.conclusion == 'success' }}
17+
runs-on: ubuntu-latest
18+
name: Deploy Preview to Cloudflare Pages
19+
steps:
20+
- name: Download build artifact
21+
uses: actions/download-artifact@v4
22+
id: preview-build-artifact
23+
with:
24+
name: preview-build
25+
path: build
26+
github-token: ${{ secrets.GITHUB_TOKEN }}
27+
run-id: ${{ github.event.workflow_run.id }}
28+
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: YOUR_PROJECT_NAME
36+
deploymentName: Preview
37+
directory: ${{ steps.preview-build-artifact.outputs.download-path }}

0 commit comments

Comments
 (0)