-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathaction.yml
36 lines (36 loc) · 1.12 KB
/
action.yml
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
name: 'ECR push and ECS deploy'
description: 'Build and push new image to AWS ECR and force new deployment of ECS service'
branding:
icon: 'upload-cloud'
color: 'orange'
inputs:
ecr-registry:
description: 'ECR registry URI'
required: true
ecr-repository:
description: 'ECR repository name'
required: true
image-tag:
description: 'ECR image tag. Defaults to latest'
required: true
default: 'latest'
ecs-cluster:
description: 'ECS cluster name. Defaults to default'
required: true
default: 'default'
ecs-service:
description: 'ECS service name'
required: true
runs:
using: "composite"
steps:
- name: Build, tag, push to AWS ECR
id: build
run: |
docker build -t ${{ inputs.ecr-registry }}/${{ inputs.ecr-repository }}:${{ inputs.image-tag }} .
docker push ${{ inputs.ecr-registry }}/${{ inputs.ecr-repository }}:${{ inputs.image-tag }}
shell: bash
- name : Force new AWS ECS deployment
run: |
aws ecs update-service --cluster ${{ inputs.ecs-cluster }} --service ${{ inputs.ecs-service }} --force-new-deployment
shell: bash