57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
name: Deploy EG-BIM QA Gateway
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
|
|
ABC_API_KEY: ${{ secrets.ABC_API_KEY }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24
|
|
|
|
- name: Validate required secrets
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
test -n "$CLOUDFLARE_API_TOKEN" || { echo "CLOUDFLARE_API_TOKEN is missing"; exit 1; }
|
|
test -n "$SESSION_SECRET" || { echo "SESSION_SECRET is missing"; exit 1; }
|
|
test -n "$ABC_API_KEY" || { echo "ABC_API_KEY is missing"; exit 1; }
|
|
|
|
- name: Install dependencies
|
|
run: npm install --no-fund --no-audit
|
|
|
|
- name: Check source
|
|
run: npm run check
|
|
|
|
- name: Register Worker session secret
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
printf '%s' "$SESSION_SECRET" | npx wrangler secret put SESSION_SECRET --name baron-qa-gateway-test
|
|
|
|
- name: Register ABC API secret
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
printf '%s' "$ABC_API_KEY" | npx wrangler secret put ABC_API_KEY --name baron-qa-gateway-test
|
|
|
|
- name: Upload static files to R2
|
|
run: npm run r2:upload
|
|
|
|
- name: Deploy Worker
|
|
run: npx wrangler deploy --name baron-qa-gateway-test
|