Browse Source

👷 add the config of docker-buildandpush

test
tchawou-daniel 6 years ago
parent
commit
d264f039b9
  1. 25
      .circleci/config.yml
  2. 4
      Dockerfile

25
.circleci/config.yml

@ -34,7 +34,7 @@ jobs:
root: /tmp root: /tmp
paths: paths:
- dist - dist
front-deploy:
fondend-deploy:
docker: docker:
- image: circleci/node:dubnium-browsers - image: circleci/node:dubnium-browsers
working_directory: ~/dist working_directory: ~/dist
@ -45,6 +45,24 @@ jobs:
name: Deploy app name: Deploy app
command: | command: |
npx netlify-cli deploy --site $NETLIFY_SITE_ID --auth $NETLIFY_ACCESS_TOKEN --dir /tmp/dist --prod 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: workflows:
version: 2.1 version: 2.1
build-deploy_frontend: build-deploy_frontend:
@ -53,6 +71,9 @@ workflows:
- build: - build:
requires: requires:
- install-dependencies - install-dependencies
- front-deploy:
- fondend-deploy:
requires:
- build
- docker-buildandpush:
requires: requires:
- build - build

4
Dockerfile

@ -0,0 +1,4 @@
FROM node:dubnium
COPY . /app
WORKDIR /app
CMD yarn global add node-gyp && yarn install && yarn start
Loading…
Cancel
Save