-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (37 loc) · 1.43 KB
/
deploy.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
name: deploy
on:
push:
branches:
- main
jobs:
deploy_ecs_staging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.DEPLOY_USER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEPLOY_USER_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: docker build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: 853558080719.dkr.ecr.us-west-2.amazonaws.com/tf-veda-wfs3-registry-west2-staging
IMAGE_TAG: latest
run: |
aws ecr get-login-password | docker login --username AWS --password-stdin $ECR_REGISTRY
cd veda-wfs3-app
docker build -t $ECR_REGISTRY:$IMAGE_TAG .
docker push $ECR_REGISTRY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY:$IMAGE_TAG"
- name: ECS refresh service
env:
ECS_SERVICE_NAME: tf-veda-wfs3-service-west2-staging
AWS_ACCESS_KEY_ID: ${{ secrets.DEPLOY_USER_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEPLOY_USER_AWS_SECRET_ACCESS_KEY }}
run: |
aws ecs update-service \
--cluster $ECS_SERVICE_NAME \
--service $ECS_SERVICE_NAME \
--task-definition $ECS_SERVICE_NAME \
--force-new-deployment