-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (49 loc) · 1.52 KB
/
ecr_deployment.yaml
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
name: Deploy to ECS
on:
push:
branches:
- 1611-create-elastic-container-service
permissions:
id-token: write
contents: read
# packages: write
jobs:
terraform:
name: Run Terraform
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./terraform/implementation/ecs
steps:
- name: Check Out Changes
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: githubECSDeploymentWorkflow
aws-region: us-east-1
- name: Load variables
env:
ENVIRONMENT: dev
BUCKET: infra-tfstate-alis-default-aizwjxuh
DYNAMODB_TABLE: infra-tfstate-lock-alis-default-aizwjxuh
REGION: us-east-1
OWNER: alis
PROJECT: infra
shell: bash
run: |
echo "ENVIRONMENT=$ENVIRONMENT" >> .env
echo "BUCKET=infra-tfstate-alis-default-aizwjxuh" >> .env
echo "DYNAMODB_TABLE=infra-tfstate-lock-alis-default-aizwjxuh" >> .env
echo "REGION=us-east-1" >> .env
echo "owner = \"$OWNER\"" >> $ENVIRONMENT.tfvars
echo "project = \"$PROJECT\"" >> $ENVIRONMENT.tfvars
echo "region = \"$REGION\"" >> $ENVIRONMENT.tfvars
- name: Terraform
run: |
ls -lhsa
./ecs.sh -e dev --ci