Skip to content

Commit 463ea7a

Browse files
committed
feat(action): add install.sh to cloudflare worker
1 parent 00ec692 commit 463ea7a

5 files changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy Install Worker
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "scripts/install.sh"
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: deploy-install-worker
12+
cancel-in-progress: true
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Copy install script to worker source
21+
run: cp scripts/install.sh scripts/install-worker/src/install.sh
22+
23+
- name: Deploy to Cloudflare Workers
24+
uses: cloudflare/wrangler-action@v3
25+
with:
26+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
27+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
28+
workingDirectory: scripts/install-worker

scripts/install-worker/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/install.sh
2+
node_modules/
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "memoh-install-worker",
3+
"private": true,
4+
"scripts": {
5+
"dev": "wrangler dev",
6+
"deploy": "wrangler deploy"
7+
},
8+
"devDependencies": {
9+
"wrangler": "^4"
10+
}
11+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import installScript from "./install.sh";
2+
3+
export default {
4+
async fetch(): Promise<Response> {
5+
return new Response(installScript, {
6+
headers: {
7+
"Content-Type": "text/plain; charset=utf-8",
8+
"Cache-Control": "public, max-age=300",
9+
},
10+
});
11+
},
12+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name = "memoh-install"
2+
main = "src/index.ts"
3+
compatibility_date = "2025-01-01"
4+
5+
[[rules]]
6+
type = "Text"
7+
globs = ["**/*.sh"]

0 commit comments

Comments
 (0)