version: 2 jobs: build: docker: - image: nikolaik/python-nodejs:python2.7-nodejs11 steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "package.json" }} - v1-dependencies- - run: name: Install npm dependencies command: npm install - run: name: Build code command: npm run build - run: name: Install python dependencies command: pip install -e . - save_cache: paths: - node_modules key: v1-dependencies-{{ checksum "package.json" }} test: docker: - image: nikolaik/python-nodejs:python2.7-nodejs11 steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "package.json" }} - v1-dependencies- - run: name: Run tests command: npm run test deploy: docker: - image: circleci/python:2.7 steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "package.json" }} - v1-dependencies- - run: name: Prepare .pypirc command: | echo -e "[pypi]" >> ~/.pypirc echo -e "username = jaedb" >> ~/.pypirc echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc - run: name: Create and distribute package to pypi command: python setup.py sdist upload -r pypi workflows: version: 2 build: jobs: - test: requires: - build filters: branches: only: develop release: jobs: - deploy: requires: - build - test filters: branches: only: master