Skip to content

Commit 8eeba10

Browse files
committed
Deploy to Cloudflare Pages via GitHub Actions
1 parent f3f800b commit 8eeba10

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
inputs:
7+
branch:
8+
type: choice
9+
description: Cloudflare Pages Branch
10+
options:
11+
- preview
12+
- production
13+
default: preview
14+
required: true
15+
16+
jobs:
17+
deploy:
18+
name: Deploy
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
deployments: write
23+
steps:
24+
- name: Checkout Repository
25+
uses: actions/checkout@v4
26+
- name: Setup Deno
27+
uses: denoland/setup-deno@v2
28+
- name: Build
29+
run: deno task build
30+
- name: Deploy
31+
uses: cloudflare/wrangler-action@v3
32+
with:
33+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
34+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
35+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
36+
command: pages deploy _site --commit-dirty=true --branch=${{ github.event.inputs.branch || 'production' }} --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }}

0 commit comments

Comments
 (0)