diff --git a/.circleci/config.yml b/.circleci/config.yml index 998c596..5702752 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ jobs: root: /tmp paths: - dist - front-deploy: + fondend-deploy: docker: - image: circleci/node:dubnium-browsers working_directory: ~/dist @@ -45,6 +45,24 @@ jobs: name: Deploy app command: | npx netlify-cli deploy --site $NETLIFY_SITE_ID --auth $NETLIFY_ACCESS_TOKEN --dir /tmp/dist --prod + docker-buildandpush: + docker: + - image: docker:17.05.0-ce-git + steps: + - checkout + - setup_remote_docker + - run: + name: Build application Docker image + command: | + docker build --cache-from=app -t app . + - deploy: + name: Publish application to docker hub + command: | + docker login -e sipetchawoudanieljordan@yahoo.fr -u sipedaniel -p $DOCKER_HUB_PASSWORD + docker tag app sipedaniel/frontend-finalproject:$CIRCLE_BUILD_NUM + docker tag app sipedaniel/frontend-finalproject:latest + docker push sipedaniel/frontend-finalproject:$CIRCLE_BUILD_NUM + docker push sipedaniel/frontend-finalproject:latest workflows: version: 2.1 build-deploy_frontend: @@ -53,6 +71,9 @@ workflows: - build: requires: - install-dependencies - - front-deploy: + - fondend-deploy: + requires: + - build + - docker-buildandpush: requires: - build \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2e12037 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM node:dubnium +COPY . /app +WORKDIR /app +CMD yarn global add node-gyp && yarn install && yarn start \ No newline at end of file