From c198c97b5a67cbcfa0826930fde5a257cab23dc3 Mon Sep 17 00:00:00 2001 From: aniebietafia Date: Tue, 5 Aug 2025 23:49:35 +0100 Subject: [PATCH] chore: automated deployment to aws ec2. Signed-off-by: aniebietafia --- .github/workflows/deploy.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d51298a..bf211b4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,13 +35,12 @@ jobs: - name: Build, tag, and push image to Amazon ECR id: build-image env: - IMAGE_TAG: ${{ github.sha }} + IMAGE_TAG: latest run: | - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . - docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest + docker build -t $ECR_REPOSITORY . + docker tag $ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest - echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:latest" >> $GITHUB_OUTPUT + echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT - name: Deploy to EC2 instance uses: appleboy/ssh-action@v1.0.3