From 249b419442a29724deb6940d5dccfe78c3f1ecb7 Mon Sep 17 00:00:00 2001 From: Siddharth Patel Date: Tue, 12 Mar 2024 01:39:51 +0530 Subject: [PATCH] docker latest image pushed integration --- .github/workflows/main.yml | 31 ++++++++++++++++--------------- Dockerrun.aws.json | 3 ++- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5772529..782f929 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ on: - testing jobs: - deploy: + deploy-docker-image: runs-on: ubuntu-latest steps: - name: Checkout Latest Repo @@ -28,19 +28,20 @@ jobs: push: true tags: siddharth9903/seistart:latest - # .github/workflows/main.yml continued - - - name: Generate Deployment Package - run: zip -r deploy.zip * -x "**node_modules**" + deploy-docker-image-to-aws-eb: + needs: deploy-docker-image + runs-on: ubuntu-latest - - name: Deploy to EB - uses: einaregilsson/beanstalk-deploy@v22 + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 with: - aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - application_name: Gateway - environment_name: seistart-docker-dev - region: ap-south-1 - version_label: ver-${{ github.sha }} - deployment_package: deploy.zip - use_existing_version_if_available: true + role-skip-session-tagging: true + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ap-south-1 + + - name: Deploy to Elastic Beanstalk + run: | + aws elasticbeanstalk create-application-version --application-name Gateway --version-label $GITHUB_SHA --source-bundle S3Bucket=docker-login-bucket-seistart,S3Key=Dockerrun.aws.json + aws elasticbeanstalk update-environment --application-name Gateway --environment-name seistart-docker-dev --version-label $GITHUB_SHA diff --git a/Dockerrun.aws.json b/Dockerrun.aws.json index af9b270..2ecb616 100644 --- a/Dockerrun.aws.json +++ b/Dockerrun.aws.json @@ -10,7 +10,8 @@ }, "Ports": [ { - "ContainerPort": "3000" + "ContainerPort": 3000, + "HostPort": 80 } ], "Logging": "/var/log/nginx"