Skip to content

Commit 380c483

Browse files
committed
ci: use Cloudflare worker github action
1 parent 09c1fc1 commit 380c483

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

.env

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
VITE_VERSION_LATEST="v11.0.0"
2-
VITE_VERSION_NEXT="v12.0.0"
2+
VITE_VERSION_NEXT="v12.0.0"
3+
CLOUDFLARE_TOKEN=DclQjcKZx4HmlLqvoiLGYpkl2Iv9oJjF0ZWNi4it
4+
CLOUDFLARE_ACCOUNT_ID=a977fc2668d151aa78c0f06261e22085

.github/workflows/deploy.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
on: [push]
2+
3+
jobs:
4+
deploy:
5+
runs-on: ubuntu-latest
6+
name: Deploy
7+
permissions:
8+
contents: read
9+
deployments: write
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Deploy
13+
uses: cloudflare/wrangler-action@v3
14+
with:
15+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
16+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
17+
command: pages deploy YOUR_DIST_FOLDER --project-name=example
18+
# Optional: Enable this if you want to have GitHub Deployments triggered
19+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ app/**/*.mjs
5151
!.yarn/releases
5252
!.yarn/sdks
5353
!.yarn/versions
54+
55+
# wrangler
56+
.wrangler

functions/echo.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export function onRequest(context) {
2+
const url = new URL(context.request.url);
3+
return new Response(url.searchParams.toString());
4+
}

0 commit comments

Comments
 (0)