From 575cc73b66e1404f5875618c5bf449ba5bfce4ba Mon Sep 17 00:00:00 2001 From: Joriz Villanueva Date: Tue, 12 Sep 2023 01:34:33 +0800 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7815eab..0ce49d6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,11 +2,12 @@ name: Docker Image CI/CD to ECR on: push: - branches: - -main # Adjust the branch name as needed + branches: + - main jobs: - build-and-deploy: + build: + name: Build Image runs-on: ubuntu-latest steps: @@ -19,20 +20,18 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 - + - name: Login to Amazon ECR id: login-ecr uses: aws-actions/amazon-ecr-login@v1 with: mask-password: 'true' - - - name: Build, tag, and push image to Amazon ECR - id: docker-pull + + - name: Build & Push Docker image + id: docker-build env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - IMAGE_TAG: latest - REPOSITORY: dk-securecodebox + ECR_REPOSITORY: cloudevopsguru/demo1 run: | chmod +x scripts.sh ./scripts.sh -