Last active
August 19, 2019 16:22
-
-
Save TheMagoo73/8146a89fe5ea169ef33ac286d68aeb2f to your computer and use it in GitHub Desktop.
React and Docker CircleCI config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remember: the Docker Orb adds the commit hash of the build to the Docker image tag automatically!