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