Skip to content

Commit bd280e7

Browse files
authored
Merge pull request #2 from withlogicco/issue-001-add-ecs-workflow
Add deploy to ECS workflow
2 parents 945639e + 9aa8811 commit bd280e7

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/ecs.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy to ECS
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
iam_role:
7+
required: true
8+
type: string
9+
region:
10+
required: false
11+
type: string
12+
default: us-east-1
13+
ecs-cluster:
14+
required: true
15+
type: string
16+
files:
17+
required: false
18+
type: string
19+
default: docker-compose.yml:docker-compose.ecs.yml
20+
env:
21+
required: false
22+
type: string
23+
default: ''
24+
env:
25+
GIT_SHA: ${{ github.sha }}
26+
27+
permissions:
28+
id-token: write
29+
contents: read
30+
31+
jobs:
32+
deploy:
33+
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v3
37+
- run: echo ${{ inputs.env }} >> $GITHUB_ENV
38+
- uses: docker/setup-buildx-action@v2
39+
- uses: aws-actions/configure-aws-credentials@v1
40+
with:
41+
role-to-assume: ${{ inputs.iam_role }}
42+
role-session-name: withlogicco-workflows-ecs-${{ github.run_id }}
43+
aws-region: ${{ inputs.region }}
44+
- uses: docker/login-action@v1
45+
with:
46+
registry: ${{ inputs.ecr-registry }}
47+
- uses: withlogicco/setup-compose-cli@v1
48+
- run: docker context create ecs aws --from-env
49+
- run: docker --context=aws compose --file ${{ inputs.files }} up

0 commit comments

Comments
 (0)