33 lines
786 B
YAML
33 lines
786 B
YAML
name: Deploy Worker
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # or 'production' depending on your branch name
|
|
workflow_dispatch: # Allows manual triggering from GitHub UI
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
name: Deploy Worker
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: "npm"
|
|
|
|
- name: Install Dependencies
|
|
run: npm ci
|
|
working-directory: ./worker
|
|
|
|
- name: Deploy to Cloudflare Workers
|
|
uses: cloudflare/wrangler-action@v4
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
workingDirectory: "worker"
|
|
command: deploy
|