Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/ci-infra-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,13 @@ jobs:
if: inputs.stack == 'api' || inputs.stack == 'all'
run: |
STACK_NAME="${{ env.PREFIX }}-api-stack"
TEMPLATE="totem-api/infrastructure/cloudformation/api.yml"
PARAMS_FILE="totem-api/infrastructure/params-api-staging.json"

# api.yml exceeds the 51,200-byte --template-body limit, so deploy from
# the S3 copy uploaded above via --template-url (1 MB limit). Bucket must
# be in the same region as the stack (us-west-2).
TEMPLATE_URL="https://${{ env.S3_BUCKET }}.s3.${{ env.AWS_REGION }}.amazonaws.com/totem-api/cloudformation/api-${{ inputs.release_version }}.yml"

# Start with Environment + AppVersion (not in param file)
PARAMS="ParameterKey=Environment,ParameterValue=${{ env.ENVIRONMENT }}"
PARAMS="$PARAMS ParameterKey=AppVersion,ParameterValue=${{ inputs.release_version }}"
Expand All @@ -193,7 +197,7 @@ jobs:
echo "Updating existing stack: $STACK_NAME"
UPDATE_OUTPUT=$(aws cloudformation update-stack \
--stack-name "$STACK_NAME" \
--template-body "file://$TEMPLATE" \
--template-url "$TEMPLATE_URL" \
--parameters $PARAMS \
--capabilities CAPABILITY_NAMED_IAM 2>&1) && {
echo "$UPDATE_OUTPUT"
Expand All @@ -210,7 +214,7 @@ jobs:
echo "Creating new stack: $STACK_NAME"
aws cloudformation create-stack \
--stack-name "$STACK_NAME" \
--template-body "file://$TEMPLATE" \
--template-url "$TEMPLATE_URL" \
--parameters $PARAMS \
--capabilities CAPABILITY_NAMED_IAM
aws cloudformation wait stack-create-complete --stack-name "$STACK_NAME"
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/prod-infra-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ jobs:
if: inputs.stack == 'api' || inputs.stack == 'all'
run: |
STACK_NAME="${{ env.PREFIX }}-api-stack"
TEMPLATE="totem-api/infrastructure/cloudformation/api.yml"

# api.yml exceeds the 51,200-byte --template-body limit, so deploy from
# the S3 copy uploaded above via --template-url (1 MB limit). Bucket must
# be in the same region as the stack (us-east-1).
TEMPLATE_URL="https://${{ env.S3_BUCKET }}.s3.${{ env.AWS_REGION }}.amazonaws.com/totem-api/cloudformation/api-${{ inputs.release_version }}.yml"

# Prod: Environment + AppVersion, Stripe params will need prod param file later
PARAMS="ParameterKey=Environment,ParameterValue=${{ env.ENVIRONMENT }}"
Expand All @@ -186,7 +190,7 @@ jobs:
echo "Updating existing stack: $STACK_NAME"
UPDATE_OUTPUT=$(aws cloudformation update-stack \
--stack-name "$STACK_NAME" \
--template-body "file://$TEMPLATE" \
--template-url "$TEMPLATE_URL" \
--parameters $PARAMS \
--capabilities CAPABILITY_NAMED_IAM 2>&1) && {
echo "$UPDATE_OUTPUT"
Expand All @@ -203,7 +207,7 @@ jobs:
echo "Creating new stack: $STACK_NAME"
aws cloudformation create-stack \
--stack-name "$STACK_NAME" \
--template-body "file://$TEMPLATE" \
--template-url "$TEMPLATE_URL" \
--parameters $PARAMS \
--capabilities CAPABILITY_NAMED_IAM
aws cloudformation wait stack-create-complete --stack-name "$STACK_NAME"
Expand Down
Loading