ci: fix workflow_dispatch trigger + simplify job structure
This commit is contained in:
@@ -7,17 +7,20 @@ on:
|
|||||||
- 'cypher-executor/**'
|
- 'cypher-executor/**'
|
||||||
- 'registry/**'
|
- 'registry/**'
|
||||||
- 'credentials/**'
|
- 'credentials/**'
|
||||||
|
workflow_dispatch: # 允許手動觸發,部署全部三個
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-cypher-executor:
|
deploy-cypher-executor:
|
||||||
name: Deploy cypher-executor
|
name: Deploy cypher-executor
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: contains(toJson(github.event.commits), 'cypher-executor') || github.event_name == 'workflow_dispatch'
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
|
- name: Install deps
|
||||||
|
working-directory: cypher-executor
|
||||||
|
run: npm install --legacy-peer-deps
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
working-directory: cypher-executor
|
working-directory: cypher-executor
|
||||||
run: npx wrangler deploy
|
run: npx wrangler deploy
|
||||||
@@ -28,12 +31,14 @@ jobs:
|
|||||||
deploy-registry:
|
deploy-registry:
|
||||||
name: Deploy registry
|
name: Deploy registry
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: contains(toJson(github.event.commits), 'registry') || github.event_name == 'workflow_dispatch'
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
|
- name: Install deps
|
||||||
|
working-directory: registry
|
||||||
|
run: npm install --legacy-peer-deps
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
working-directory: registry
|
working-directory: registry
|
||||||
run: npx wrangler deploy
|
run: npx wrangler deploy
|
||||||
@@ -44,24 +49,17 @@ jobs:
|
|||||||
deploy-credentials:
|
deploy-credentials:
|
||||||
name: Deploy credentials
|
name: Deploy credentials
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: contains(toJson(github.event.commits), 'credentials') || github.event_name == 'workflow_dispatch'
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
|
- name: Install deps
|
||||||
|
working-directory: credentials
|
||||||
|
run: npm install --legacy-peer-deps
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
working-directory: credentials
|
working-directory: credentials
|
||||||
run: npx wrangler deploy
|
run: npx wrangler deploy
|
||||||
env:
|
env:
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
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