From 2ccdfea952deea9e6a9f134beecf612bb359249f Mon Sep 17 00:00:00 2001 From: Luxshan2000 Date: Fri, 29 Sep 2023 03:39:46 +0530 Subject: [PATCH] review --- .github/workflows/workflow.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f19bd5a..8a5c04a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,12 +1,12 @@ -name: CICD +name: CICD Frontend on: push: branches: [main] jobs: - build-frontend: - runs-on: self-hosted + build: + runs-on: [ubuntu-latest] steps: - name: Checkout source uses: actions/checkout@v3 @@ -16,17 +16,19 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build docker image - run: docker build -t luxshan/aws-pipeline ./frontend + run: docker build -t luxshan/aws-pipeline/frontend ./frontend - name: Publish image to docker hub - run: docker push luxshan/aws-pipeline:latest + run: docker push luxshan/aws-pipeline/frontend + + deploy: needs: build runs-on: [aws-ec2] steps: - name: Pull image from docker hub - run: docker pull luxshan/aws-pipeline + run: docker pull luxshan/aws-pipeline/frontend:latest - name: Delete old container - run: docker rm -f aws-pipeline-container + run: docker rm -f aws-pipeline-frontend-container - name: Run docker container - run: docker run -d -p 3000:3000 --name aws-pipeline-container luxshan/aws-pipeline \ No newline at end of file + run: docker run -d -p 3000:3000 --name aws-pipeline-frontend-container luxshan/aws-pipeline/frontend