# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version2
references
container_config&container_config
docker
image circleci/node9
working_directory ~/repo
jobs
checkout_code
<<*container_config
steps
checkoutsave_cache
key v1-repo- .Environment.CIRCLE_SHA1
paths ~/repo
bundle_dependencies
<<*container_config
steps
restore_cache
key v1-repo- .Environment.CIRCLE_SHA1
restore_cache
key v1-bundle- checksum "yarn.lock"
run
name install-dependencies
command yarn install
save_cache
key v1-bundle- checksum "yarn.lock"
paths
node_modulesinstall_up
<<*container_config
steps
run
name install-up-runtime
command
curl -sf https://up.apex.sh/install | bash -s -- -b ~/up_bin
~/up_bin/up -v upgrade
save_cache
key v1-bin- .Environment.CIRCLE_SHA1
paths
~/up_bindeploy_to_staging
<<*container_config
steps
restore_cache
key v1-repo- .Environment.CIRCLE_SHA1
restore_cache
key v1-bundle- checksum "yarn.lock"
restore_cache
key v1-bin- .Environment.CIRCLE_SHA1
deploy
name deploy-with-up
command
~/up_bin/up deploy staging
deploy_to_production
<<*container_config
steps
restore_cache
key v1-repo- .Environment.CIRCLE_SHA1
restore_cache
key v1-bundle- checksum "yarn.lock"
restore_cache
key v1-bin- .Environment.CIRCLE_SHA1
deploy
name deploy-with-up
command
~/up_bin/up deploy production
workflows
version2
build_and_deploy
jobs
checkout_codebundle_dependencies
requires
checkout_code
install_updeploy_to_staging
filters
branches
only
developrequires
install_up
bundle_dependenciesdeploy_to_production
filters
branches
only
masterrequires
install_up
bundle_dependencies