version: 2.1 aliases: - &defaults docker: - image: cimg/node:12.22.11-browsers auth: username: $DOCKERHUB_USERNAME password: $DOCKERHUB_PASSWORD working_directory: ~/repo environment: NODE_ENV: production RELEASE_TIMESTAMP: "$(date +'%Y%m%d%H%M%S')" - &setup name: "setup" command: | npm --production=false ci mkdir ./test/results - &lint name: "run lint tests" command: npm run lint -- --format junit -o ./test/results/lint-results.xml - &unit name: "run unit tests" command: JEST_JUNIT_OUTPUT_NAME=unit-jest-results.xml npm run unit -- --reporters=jest-junit - &build name: "run npm build" command: | NODE_ENV=production npm run build jobs: build-test: <<: *defaults steps: - checkout - run: <<: *setup - run: <<: *lint - run: <<: *unit - run: <<: *build - store_test_results: path: test/results workflows: build-test-no-deploy: jobs: - build-test: context: - dockerhub-credentials filters: branches: ignore: - master - develop - /^hotfix\/.*/