generated from kimyvgy/worker-apollo-server-template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (65 loc) · 4 KB
/
deploy_prod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Deploy to PROD
on:
workflow_run:
# Esto tiene q hacer match con los nombres de los workflows de tests
workflows: ["Graphql and Database Tests", "Lint and Typecheck"]
branches: [release]
types:
- completed
jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Deploy to Cloudflare Workers PRODUCTION
runs-on: ubuntu-latest
steps:
- name: ⏳ Cloning repo
uses: actions/checkout@v4
with:
show-progress: false
- name: ⬢ Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: 📦 Download Cached Package Dependencies
uses: actions/cache@v3
env:
cache-name: NPM
with:
path: ~/.npm
key: CACHE-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- name: 📥 Install dependencies
run: npm ci --prefer-offline --no-audit --legacy-peer-deps --cache ~/.npm
# Deploy the email RPC Service
- name: 🛳️ DEPLOY EMAIL-RPC SERVICE WORKER
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=production --minify --config ./workers/transactional_email_service/wrangler.toml
# Deploy the svg-renderer
- name: 🛳️ DEPLOY SVG-RENDERER WORKER
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=production --minify --config ./workers/svg_renderer/wrangler.toml
# Deploy the auth tokens worker
- name: 🛳️ DEPLOY AUTH-TOKEN WORKER
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=production --minify --config ./workers/auth_tokens/wrangler.toml
# Deploy the wall of fame worker
- name: 🛳️ DEPLOY WALL-OF-FAME WORKER
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=production --minify --config ./workers/wall_of_fame_cron/wrangler.toml
# Deploy the purchase order sync cron worker
- name: 🛳️ DEPLOY WALL-OF-FAME WORKER
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=production --minify --config ./workers/purchase_order_payment_sync_cron/wrangler.toml
# Deploy the email webhook worker
- name: 🛳️ DEPLOY EMAIL_WEBHOOK WORKER
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=production --minify --config ./workers/email_webhook/wrangler.toml
# Deploy the sanity asset importer worker
- name: 🛳️ DEPLOY SANITY-ASSET-IMPORTER WORKER
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=production --minify --config ./workers/sanity_asset_importer/wrangler.toml
# Deploy the API
- name: 🛳️ DEPLOY API WORKER
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=production --minify
# Redeploy the EMAIL queue consumer
- name: 💀/🛳️ RE-DEPLOY queue consumer
run: |
CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler queues consumer remove mail-queue-production mail-queue-consumer-production && \
CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=production --minify --config ./workers/email_queue/wrangler.toml
# Redeploy the Google Import consumer
- name: 💀/🛳️ RE-DEPLOY GOOGLE-IMPORT queue consumer
run: |
CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler queues consumer remove google-photos-import-queue-production google-import-queue-consumer-production && \
CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=production --minify --config ./workers/google_import_queue_consumer/wrangler.toml