ci: add GitHub Actions deploy workflow for 3 Workers
Auto-deploys on push to main when files in cypher-executor/, registry/, or credentials/ change. Manual dispatch deploys all three. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,67 @@
|
|||||||
|
name: Deploy Workers
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'cypher-executor/**'
|
||||||
|
- 'registry/**'
|
||||||
|
- 'credentials/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy-cypher-executor:
|
||||||
|
name: Deploy cypher-executor
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: contains(toJson(github.event.commits), 'cypher-executor') || github.event_name == 'workflow_dispatch'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
- name: Deploy
|
||||||
|
working-directory: cypher-executor
|
||||||
|
run: npx wrangler deploy
|
||||||
|
env:
|
||||||
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
|
|
||||||
|
deploy-registry:
|
||||||
|
name: Deploy registry
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: contains(toJson(github.event.commits), 'registry') || github.event_name == 'workflow_dispatch'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
- name: Deploy
|
||||||
|
working-directory: registry
|
||||||
|
run: npx wrangler deploy
|
||||||
|
env:
|
||||||
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
|
|
||||||
|
deploy-credentials:
|
||||||
|
name: Deploy credentials
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: contains(toJson(github.event.commits), 'credentials') || github.event_name == 'workflow_dispatch'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
- name: Deploy
|
||||||
|
working-directory: credentials
|
||||||
|
run: npx wrangler deploy
|
||||||
|
env:
|
||||||
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
|
|
||||||
|
# 手動觸發:部署全部三個 Worker
|
||||||
|
deploy-all:
|
||||||
|
name: Deploy all (manual)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
|
needs: [deploy-cypher-executor, deploy-registry, deploy-credentials]
|
||||||
|
steps:
|
||||||
|
- run: echo "All workers deployed"
|
||||||
Reference in New Issue
Block a user