From 06777becbeea82f829981005158add056045177d Mon Sep 17 00:00:00 2001 From: phuongnam406 <57904907+phuongnam406@users.noreply.github.com> Date: Wed, 13 Jul 2022 11:06:14 +0700 Subject: [PATCH 1/3] Add .circleci/config.yml --- .circleci/config.yml | 63 +++++++++++--------------------------------- 1 file changed, 16 insertions(+), 47 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 705023c..37edaac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,52 +1,21 @@ -# my config +# This config is equivalent to both the '.circleci/extended/orb-free.yml' and the base '.circleci/config.yml' version: 2.1 -orbs: - node: circleci/node@3.0.0 - docker: circleci/docker@1.4.0 -jobs: - build-and-push: - environment: - DOCKER_IMAGE: nhtua/react-docker - DOCKER_TAG: latest - executor: docker/docker - steps: - - setup_remote_docker - - checkout - - docker/check: - docker-username: DOCKER_USER - docker-password: DOCKER_PASSWORD - - docker/build: - image: $DOCKER_IMAGE - tag: $DOCKER_TAG - - docker/push: - digest-path: /tmp/digest.txt - image: $DOCKER_IMAGE - tag: $DOCKER_TAG - - run: - command: | - echo "Digest is: $( Date: Wed, 13 Jul 2022 15:09:09 +0700 Subject: [PATCH 2/3] test --- .circleci/config.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 37edaac..a6e01fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,18 +4,11 @@ version: 2.1 # Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. # See: https://circleci.com/docs/2.0/orb-intro/ orbs: - node: circleci/node@4.7 + node: circleci/node@3.0.0 # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: - sample: # This is the name of the workflow, feel free to change it to better match your workflow. - # Inside the workflow, you define the jobs you want to run. + node-tests: jobs: - - node/test: - # This is the node version to use for the `cimg/node` tag - # Relevant tags can be found on the CircleCI Developer Hub - # https://circleci.com/developer/images/image/cimg/node - version: '16.10' - # If you are using yarn, change the line below from "npm" to "yarn" - pkg-manager: npm + - node/test From fcc7154837b99c44725c812763377ec2857b2988 Mon Sep 17 00:00:00 2001 From: phuongnam406 <57904907+phuongnam406@users.noreply.github.com> Date: Wed, 13 Jul 2022 15:12:44 +0700 Subject: [PATCH 3/3] deploy --- .circleci/config.yml | 47 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a6e01fe..fc2e503 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,14 +1,47 @@ -# This config is equivalent to both the '.circleci/extended/orb-free.yml' and the base '.circleci/config.yml' version: 2.1 - -# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. -# See: https://circleci.com/docs/2.0/orb-intro/ orbs: node: circleci/node@3.0.0 + docker: circleci/docker@1.4.0 +#firt test +jobs: + build-and-push: + environment: + DOCKER_IMAGE: phuongnam406/react-docker + DOCKER_TAG: latest + executor: docker/docker + steps: + - setup_remote_docker + - checkout + - docker/check: + docker-username: DOCKER_USER + docker-password: DOCKER_PASSWORD + - docker/build: + image: $DOCKER_IMAGE + tag: $DOCKER_TAG + - docker/push: + digest-path: /tmp/digest.txt + image: $DOCKER_IMAGE + tag: $DOCKER_TAG + - run: + command: | + echo "Digest is: $(