From a2d87b063bd5c8957ea630f1cf6ef19fd685cb32 Mon Sep 17 00:00:00 2001 From: shadabmalikshah <97905885+shadabmalikshah@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:18:35 +0530 Subject: [PATCH] Create config.yml --- .circleci/config.yml | 49 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..8f563a7 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,49 @@ +version: 2.1 + +executors: + docker-executor: + docker: + - image: circleci/node:14 + +jobs: + build: + executor: docker-executor + steps: + - checkout + + - run: + name: Install Dependencies + command: | + cd frontend + npm install + + - run: + name: Build Project + command: | + cd frontend + npm run build + + - setup_remote_docker: + version: 20.10.7 + docker_layer_caching: true + + - run: + name: Build Docker Image + command: | + cd frontend + docker build -t shadabmaliks/circleci_react:latest . + + - run: + name: Log in to Docker Hub + command: echo "${circleci_docker_password}" | docker login -u "${circelci_docker_username}" --password-stdin + + - run: + name: Push Docker Image + command: | + docker push shadabmaliks/circleci_react:latest + +workflows: + version: 2 + build_and_push: + jobs: + - build