Skip to content

Commit 4a03c56

Browse files
Update GitHub Actions for Cloudflare Pages deployment
1 parent 5de8a57 commit 4a03c56

File tree

1 file changed

+12
-30
lines changed

1 file changed

+12
-30
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,22 @@
1-
name: Build and Deploy to gh-pages
1+
name: Trigger Cloudflare Pages
22

33
on:
44
release:
55
types: [published]
66

77
permissions:
8-
contents: write
8+
contents: read
99

1010
jobs:
11-
build-and-deploy:
11+
trigger-pages:
1212
runs-on: ubuntu-latest
13-
1413
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v4
17-
18-
- name: Install pnpm
19-
uses: pnpm/action-setup@v4
20-
with:
21-
version: 10
22-
23-
- name: Use Node.js
24-
uses: actions/setup-node@v4
25-
with:
26-
node-version: 20
27-
cache: 'pnpm'
28-
29-
- name: Install dependencies
30-
run: pnpm install
31-
32-
- name: Build the site
33-
run: pnpm run build
34-
35-
- name: Deploy to gh-pages branch
36-
uses: peaceiris/actions-gh-pages@v3
37-
with:
38-
github_token: ${{ secrets.GITHUB_TOKEN }}
39-
publish_dir: dist
40-
publish_branch: gh-pages
14+
- name: Trigger Cloudflare Pages deploy hook
15+
env:
16+
HOOK_URL: ${{ secrets.CLOUDFLARE_DEPLOY_HOOK_URL }}
17+
run: |
18+
if [ -z "$HOOK_URL" ]; then
19+
echo "CLOUDFLARE_DEPLOY_HOOK_URL not set"
20+
exit 1
21+
fi
22+
curl -X POST "$HOOK_URL" --fail --show-error

0 commit comments

Comments
 (0)