Skip to content

Commit

Permalink
workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjrmy committed Jun 19, 2024
1 parent c4f029b commit a1fe194
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/deploy-worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: cloudflare

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
ci:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest ]
node: [ 16 ]

steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Checkout
uses: actions/checkout@master

- name: Cache node_modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm i

- name: Publish to Cloudflare
uses: cloudflare/wrangler-action@v3
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"dev:wrangler": "wrangler pages dev dist --live-reload",
"dev:esbuild": "esbuild --bundle src/index.ts --format=esm --watch --outfile=dist/_worker.js",
"build": "esbuild --bundle src/index.ts --format=esm --outfile=dist/_worker.js",
"deploy": "wrangler pages publish dist"
"deploy:pages": "wrangler pages publish dist",
"deploy:worker": "wrangler deploy --minify src/index.ts"
},
"dependencies": {
"hono": "^4.4.7"
Expand Down

0 comments on commit a1fe194

Please sign in to comment.