Skip to content

Deploy GutPacer closed beta #11

Deploy GutPacer closed beta

Deploy GutPacer closed beta #11

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