Skip to content

Commit 0273917

Browse files
committed
ci: use Cloudflare worker github action
1 parent 50f1807 commit 0273917

File tree

6 files changed

+921
-13
lines changed

6 files changed

+921
-13
lines changed

.env

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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: Setup yarn
13+
uses: actions/setup-node@v3
14+
with:
15+
cache: 'yarn'
16+
node-version: '24'
17+
- name: Build
18+
run: |
19+
yarn install
20+
yarn build
21+
- name: Deploy
22+
uses: cloudflare/wrangler-action@v3
23+
with:
24+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
25+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
26+
command: pages deploy public --project-name=rescript-lang.org
27+
# Optional: Enable this if you want to have GitHub Deployments triggered
28+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,11 @@ app/**/*.jsx
5757
!.yarn/sdks
5858
!.yarn/versions
5959

60+
# wrangler
61+
.wrangler
62+
6063
# Scripts generated from rolldown to convert them from .jsx files to .mjs files
61-
_scripts
64+
_scripts
65+
66+
# Local env files
67+
.env

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+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"vite": "^7.0.6",
9494
"vite-plugin-devtools-json": "^1.0.0",
9595
"vite-plugin-env-compatible": "^2.0.1",
96-
"vite-plugin-page-reload": "^0.2.2"
96+
"vite-plugin-page-reload": "^0.2.2",
97+
"wrangler": "^4.52.0"
9798
}
9899
}

0 commit comments

Comments
 (0)