Skip to content

Instantly share code, notes, and snippets.

@TheMagoo73
Last active August 19, 2019 16:22
Show Gist options
  • Save TheMagoo73/8146a89fe5ea169ef33ac286d68aeb2f to your computer and use it in GitHub Desktop.
Save TheMagoo73/8146a89fe5ea169ef33ac286d68aeb2f to your computer and use it in GitHub Desktop.
React and Docker CircleCI config
version: 2.1
orbs:
docker: circleci/docker@0.5.13
jobs:
run_tests:
working_directory: ~/react-app
docker:
- image: circleci/node:10.16.3
steps:
- checkout
- run:
name: update-npm
command: 'sudo npm install -g npm@latest'
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: npm-install
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- run:
name: test
command: npm test
workflows:
version: 2
build_deploy:
jobs:
- run_tests
- docker/publish:
image: gumshoe/$CIRCLE_PROJECT_REPONAME
dockerfile: dockerfile
requires:
- run_tests
filters:
branches:
only:
- master
@TheMagoo73
Copy link
Author

Remember: the Docker Orb adds the commit hash of the build to the Docker image tag automatically!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment