Skip to content

Commit

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

0 comments on commit fb350dd

Please sign in to comment.