Skip to content

Commit dcc47ee

Browse files
committed
Add terra prod deploy workflow
1 parent 1900fa4 commit dcc47ee

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy The World terra stack, production
2+
3+
on:
4+
workflow_dispatch:
5+
6+
concurrency:
7+
group: ${{ github.workflow }}
8+
9+
permissions:
10+
id-token: write
11+
contents: read
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v5
19+
20+
- name: Configure AWS Credentials
21+
uses: aws-actions/configure-aws-credentials@v4
22+
with:
23+
aws-region: us-east-1
24+
role-to-assume: arn:aws:iam::976680550710:role/PRX-GHA-AccessRole
25+
role-session-name: gha-deploy-terra-stag
26+
27+
- name: Update Parameter Store for Production
28+
run: |
29+
staging_sha=$(aws cloudformation describe-stacks --region us-east-1 --stack-name terra-stag --query "Stacks[0].Outputs[?OutputKey=='WordPressEcrImageTag'].OutputValue" --output text)
30+
aws ssm put-parameter \
31+
--region us-east-1 \
32+
--name /prx/prod/Terra/The_World-WordPress/pkg/docker-image-tag \
33+
--value "github/prx/the-world-cms-wordpress:${staging_sha}" \
34+
--overwrite
35+
36+
- name: Deploy CloudFormation stack
37+
working-directory: theworld/terra/templates
38+
run: |
39+
sam build \
40+
--template-file root.yml \
41+
&& sam deploy \
42+
--region us-east-1 \
43+
--no-confirm-changeset \
44+
--no-fail-on-empty-changeset \
45+
--stack-name terra-prod \
46+
--resolve-s3 \
47+
--s3-prefix terra-prod \
48+
--capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND \
49+
--role-arn arn:aws:iam::976680550710:role/PRX-GHA-ServiceRoleForCloudFormation

0 commit comments

Comments
 (0)