diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f927516..d90b840 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,35 +3,30 @@ name: Docker Image CI/CD to ECR on: push: branches: [ main ] # Adjust the branch name as needed - jobs: - build-and-push: - name: Build and push to ECR + build-and-deploy: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - + - name: Checkout source + uses: actions/checkout@v3 - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v3 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - + aws-region: 'us-east-1' - name: Login to Amazon ECR - id: Login-ecr + id: login-ecr uses: aws-actions/amazon-ecr-login@v1 - - - name: Run Docker image push script + with: + mask-password: 'true' + + - name: Build, tag, and push image to Amazon ECR + id: build-image env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - ECR_REPOSITORY: dk-securecodebox + IMAGE_TAG: latest + REPOSITORY: dk-securecodebox run: | chmod +x push_images_to_ecr.sh ./scripts.sh