Repository navigation
88 lines (81 loc) · 2.71 KB
/
Copy pathdeploy-closed-beta.yml
File metadata and controls
88 lines (81 loc) · 2.71 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Deploy GutPacer closed beta
# WARNING: two workflows deploy the same function.
# - this file -> backend/notifier/index-mvp.mjs (what runs in production)
# - deploy-notifier.yml -> backend/notifier/index.mjs (the old implementation)
# Whichever runs last wins. Always look at both before changing either.
# On 2026-08-27 the old implementation overwrote production and rolled it back.
on:
workflow_dispatch:
inputs:
component:
description: Component to deploy
required: true
type: choice
options:
- api-dev
- notifier
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
permissions:
id-token: write
contents: read
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- run: npm ci
- run: npm test
deploy-api-dev:
if: inputs.component == 'api-dev'
needs: verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials via OIDC
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_ARN }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Package closed-beta API
run: |
mkdir package
cp backend/index-mvp.mjs package/index.mjs
cp backend/line-auth.mjs package/line-auth.mjs
cp backend/profile-defaults.mjs package/profile-defaults.mjs
cp backend/invite-assignments.mjs package/invite-assignments.mjs
cp backend/care-event-export.mjs package/care-event-export.mjs
cd package
zip ../function.zip ./*.mjs
- name: Deploy development API
run: |
aws lambda update-function-code \
--function-name gutpacer-mvp-dev \
--zip-file fileb://function.zip \
--region ap-northeast-1
deploy-notifier:
if: inputs.component == 'notifier'
needs: verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials via OIDC
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_ARN }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Package closed-beta notifier
run: |
mkdir package
cp backend/notifier/index-mvp.mjs package/index.mjs
cd package
zip ../function.zip ./*.mjs
- name: Deploy notifier
run: |
aws lambda update-function-code \
--function-name gutpacer-notifier \
--zip-file fileb://function.zip \
--region ap-northeast-1