Skip to content

Commit

Permalink
cloudflare deploy button
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjvs committed Sep 14, 2023
1 parent d42c5d6 commit 1b5a306
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/cloudflare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy Worker

# this action is for the "deploy to cloudflare" button
# repository_dispatch is triggered by CF
# secrets should also be made by CF

on: ["repository_dispatch"]

jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Install npm packages
run: npm install

- name: Build Project
run: npm run build:cloudflare

- name: Build & Deploy Worker
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@

Simple reverse proxy to bypass CORS, used by [movie-web](https://movie-web.app).

features:
[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/YOURUSERNAME/YOURREPO)

---

### features:
- Deployable on many platforms - thanks to nitro
- header rewrites - read and write protected headers
- bypass CORS - always allows browser to send requests through it

supported platforms:
### supported platforms:
- cloudflare workers
- AWS lambda
- nodejs

## Todos:
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"prepare": "nitropack prepare",
"dev": "nitropack dev",
"build": "nitropack build",
"build:cloudflare": "NITRO_PRESET=cloudflare npm run build",
"build:aws": "NITRO_PRESET=aws_lambda npm run build",
"build:node": "NITRO_PRESET=node-server npm run build",
"start": "node .output/server/index.mjs",
"lint": "eslint --ext .js src/",
"lint:fix": "eslint --fix --ext .js src/"
Expand Down

0 comments on commit 1b5a306

Please sign in to comment.