From 388b5e891c3e4bc072b896952d8f3a0f17e9783b Mon Sep 17 00:00:00 2001 From: SINGHxTUSHAR Date: Sun, 3 Dec 2023 19:57:41 +0530 Subject: [PATCH] Commenting out the code --- .github/workflows/main.yml | 158 +++++++++++++++++++------------------ 1 file changed, 80 insertions(+), 78 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 83a16f1..22031ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,96 +1,98 @@ -name: workflow +## "If required then comment out the code and use accordingly you need" -on: - push: - branches: - - main - paths-ignore: - - 'README.md' +# name: workflow -permissions: - id-token: write - contents: read +# on: +# push: +# branches: +# - main +# paths-ignore: +# - 'README.md' -jobs: - integration: - name: Continuous Integration - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v3 +# permissions: +# id-token: write +# contents: read - - name: Lint code - run: echo "Linting repository" +# jobs: +# integration: +# name: Continuous Integration +# runs-on: ubuntu-latest +# steps: +# - name: Checkout Code +# uses: actions/checkout@v3 - - name: Run unit tests - run: echo "Running unit tests" +# - name: Lint code +# run: echo "Linting repository" - build-and-push-ecr-image: - name: Continuous Delivery - needs: integration - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v3 +# - name: Run unit tests +# run: echo "Running unit tests" - - name: Install Utilities - run: | - sudo apt-get update - sudo apt-get install -y jq unzip - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_DEFAULT_REGION }} +# build-and-push-ecr-image: +# name: Continuous Delivery +# needs: integration +# runs-on: ubuntu-latest +# steps: +# - name: Checkout Code +# uses: actions/checkout@v3 - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 +# - name: Install Utilities +# run: | +# sudo apt-get update +# sudo apt-get install -y jq unzip +# - name: Configure AWS credentials +# uses: aws-actions/configure-aws-credentials@v1 +# with: +# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} +# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - - name: Build, tag, and push image to Amazon ECR - id: build-image - env: - IMAGE_TAG: latest - run: | - # Build a docker container and - # push it to ECR so that it can - # be deployed to ECS. - docker build -t ${{ secrets.AWS_ECR_REPO_URI }}:$IMAGE_TAG . - docker push ${{ secrets.AWS_ECR_REPO_URI }}:$IMAGE_TAG +# - name: Login to Amazon ECR +# id: login-ecr +# uses: aws-actions/amazon-ecr-login@v1 + +# - name: Build, tag, and push image to Amazon ECR +# id: build-image +# env: +# IMAGE_TAG: latest +# run: | +# # Build a docker container and +# # push it to ECR so that it can +# # be deployed to ECS. +# docker build -t ${{ secrets.AWS_ECR_REPO_URI }}:$IMAGE_TAG . +# docker push ${{ secrets.AWS_ECR_REPO_URI }}:$IMAGE_TAG - Continuous-Deployment: - needs: build-and-push-ecr-image - runs-on: self-hosted - steps: - - name: Checkout - uses: actions/checkout@v3 +# Continuous-Deployment: +# needs: build-and-push-ecr-image +# runs-on: self-hosted +# steps: +# - name: Checkout +# uses: actions/checkout@v3 - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_DEFAULT_REGION }} +# - name: Configure AWS credentials +# uses: aws-actions/configure-aws-credentials@v1 +# with: +# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} +# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 +# - name: Login to Amazon ECR +# id: login-ecr +# uses: aws-actions/amazon-ecr-login@v1 - - name: Pull latest images - run: | - docker pull ${{ secrets.AWS_ECR_REPO_URI }}:latest +# - name: Pull latest images +# run: | +# docker pull ${{ secrets.AWS_ECR_REPO_URI }}:latest - # - name: Stop and remove visibility container if running - # run: | - # docker ps -q --filter "name=visibility" | grep -q . && docker stop visibility && docker rm -fv visibility - - name: Run Docker Image to serve users - run: | - docker run -d -p 5000:5000 --name=sensor -e 'AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}' -e 'AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}' -e 'AWS_DEFAULT_REGION=${{ secrets.AWS_DEFAULT_REGION }}' ${{ secrets.AWS_ECR_REPO_URI }}:latest +# # - name: Stop and remove visibility container if running +# # run: | +# # docker ps -q --filter "name=visibility" | grep -q . && docker stop visibility && docker rm -fv visibility +# - name: Run Docker Image to serve users +# run: | +# docker run -d -p 5000:5000 --name=sensor -e 'AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}' -e 'AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}' -e 'AWS_DEFAULT_REGION=${{ secrets.AWS_DEFAULT_REGION }}' ${{ secrets.AWS_ECR_REPO_URI }}:latest - - name: Clean previous images and containers - run: | - docker system prune -f \ No newline at end of file +# - name: Clean previous images and containers +# run: | +# docker system prune -f \ No newline at end of file