From 0775c61d39a91bec18e1231013cf0247ffeda69c Mon Sep 17 00:00:00 2001 From: Baba-jyde <129980016+Baba-jyde@users.noreply.github.com> Date: Sat, 3 Jun 2023 12:13:25 -0400 Subject: [PATCH 1/3] Create main.yml --- .github/workflows/main.yml | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ee8087d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,52 @@ +name: ECR + +on: + push: + branches: [ master ] + +jobs: + + build: + + name: Build Image + runs-on: ubuntu-latest + + + steps: + + - name: Check out code + uses: actions/checkout@v2 + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} + AWS_REGION: us-east-1 + - name: Building the web app and push image to Amazon ECR + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REPOSITORY: webapp_nubila_ecr + IMAGE_TAG: v0.1 + run: | + cd web_app/ + ls -ltra + # Docker build + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + docker ps + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG + + - name: Building the sql and push image to Amazon ECR + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REPOSITORY: sql_nubila_ecr + IMAGE_TAG: v0.1 + run: | + cd sql_app/ + ls -ltra + # Docker building + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + docker ps + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG From 65ce947d33d88446408ab247827ac6d2b460e520 Mon Sep 17 00:00:00 2001 From: Baba-jyde <129980016+Baba-jyde@users.noreply.github.com> Date: Mon, 5 Jun 2023 17:11:47 -0400 Subject: [PATCH 2/3] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ee8087d..92fb07f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: - name: Building the web app and push image to Amazon ECR env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - ECR_REPOSITORY: webapp_nubila_ecr + ECR_REPOSITORY: babajide-webapp IMAGE_TAG: v0.1 run: | cd web_app/ @@ -41,7 +41,7 @@ jobs: - name: Building the sql and push image to Amazon ECR env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - ECR_REPOSITORY: sql_nubila_ecr + ECR_REPOSITORY: babajide-mysql IMAGE_TAG: v0.1 run: | cd sql_app/ From d0ec6a0caa134a9e10dfe25c61f3fc629284c696 Mon Sep 17 00:00:00 2001 From: Baba-jyde <129980016+Baba-jyde@users.noreply.github.com> Date: Mon, 5 Jun 2023 17:52:10 -0400 Subject: [PATCH 3/3] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 92fb07f..eb78a9f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: ECR on: push: - branches: [ master ] + branches: [ main ] jobs: