Skip to content

Merge pull request #55 from avrae/AVR-525 #18

Merge pull request #55 from avrae/AVR-525

Merge pull request #55 from avrae/AVR-525 #18

Workflow file for this run

name: Deploy
on:
push:
branches:
- master
workflow_dispatch:
jobs:
deploy:
name: Deploy to ECS
runs-on: ubuntu-latest
env:
CLUSTER_NAME: avrae
SERVICE_NAME: taine
DEPLOY_ENV: live
REGION: us-east-1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: avrae/${{ env.SERVICE_NAME }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $SERVICE_NAME .
docker tag $SERVICE_NAME $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker tag $SERVICE_NAME $ECR_REGISTRY/$ECR_REPOSITORY:$DEPLOY_ENV
docker push -a $ECR_REGISTRY/$ECR_REPOSITORY
- name: Deploy Amazon ECS task definition
run: |
aws ecs update-service --cluster $CLUSTER_NAME-$DEPLOY_ENV --service $SERVICE_NAME --force-new-deployment --region $REGION