Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jrzvnn committed Sep 11, 2023
1 parent 4292152 commit 575cc73
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

0 comments on commit 575cc73

Please sign in to comment.