Yield generated for e26fe4c8-24ae-49e7-baf7-feda92abc026
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

62 lines
1.7 KiB

version: 2.1
jobs:
build:
docker:
- image: circleci/node:dubnium-browsers
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }}
- dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }}
docker_build:
environment:
IMAGE_NAME: sgttabouret/devops-final-front
docker:
- image: circleci/buildpack-deps:stretch
steps:
- checkout
- setup_remote_docker
- run: docker image build --tag $IMAGE_NAME:app .
- run: docker save -o image.tar $IMAGE_NAME
- persist_to_workspace:
root: .
paths:
- ./image.tar
docker_push:
environment:
IMAGE_NAME: sgttabouret/devops-final-front
docker:
- image: circleci/buildpack-deps:stretch
steps:
- attach_workspace:
at: /tmp/workspace
- setup_remote_docker
- run: docker load -i /tmp/workspace/image.tar
- run:
name: Login and push to DockerHub
command: |
echo "$DOCKERHUB_PASS" | docker login --username sgttabouret --password-stdin
docker tag $IMAGE_NAME:app $IMAGE_NAME:$CIRCLE_BUILD_NUM
docker tag $IMAGE_NAME:app $IMAGE_NAME:latest
docker push $IMAGE_NAME:$CIRCLE_BUILD_NUM
docker push $IMAGE_NAME:latest
workflows:
build_deploy_netlify:
jobs:
- build
- docker_build:
requires:
- build
- docker_push:
requires:
- docker_build
context:
- back_final