2022-03-17 10:20:40 -04:00
|
|
|
version: 2.1
|
2022-08-25 13:44:51 -04:00
|
|
|
orbs:
|
|
|
|
browser-tools: circleci/browser-tools@1.2.4
|
2022-08-25 17:53:06 -04:00
|
|
|
node: circleci/node@5.0.2
|
|
|
|
commitlint: conventional-changelog/commitlint@1.0.0
|
2022-03-17 10:20:40 -04:00
|
|
|
aliases:
|
|
|
|
- &defaults
|
|
|
|
docker:
|
2022-08-25 13:44:51 -04:00
|
|
|
- image: cimg/node:lts-browsers
|
2022-03-29 13:36:11 -04:00
|
|
|
auth:
|
|
|
|
username: $DOCKERHUB_USERNAME
|
|
|
|
password: $DOCKERHUB_PASSWORD
|
2022-03-17 10:20:40 -04:00
|
|
|
working_directory: ~/repo
|
|
|
|
environment:
|
|
|
|
NODE_ENV: production
|
|
|
|
- &setup
|
2022-08-25 13:44:51 -04:00
|
|
|
node/install-packages:
|
|
|
|
override-ci-command: npm --production=false ci
|
2022-03-17 10:20:40 -04:00
|
|
|
- &lint
|
2022-08-25 13:44:51 -04:00
|
|
|
run:
|
|
|
|
name: "run lint tests"
|
|
|
|
command: npm run lint -- --format junit -o ./test/results/lint-results.xml
|
2022-03-17 10:20:40 -04:00
|
|
|
- &unit
|
2022-08-25 13:44:51 -04:00
|
|
|
run:
|
|
|
|
name: "run unit tests"
|
|
|
|
command: JEST_JUNIT_OUTPUT_NAME=unit-jest-results.xml npm run unit -- --reporters=jest-junit
|
2022-03-17 10:20:40 -04:00
|
|
|
- &build
|
2022-08-25 13:44:51 -04:00
|
|
|
run:
|
|
|
|
name: "run npm build"
|
|
|
|
command: |
|
|
|
|
NODE_ENV=production npm run build
|
2022-04-11 16:53:11 -04:00
|
|
|
- &deploy-gh-pages
|
2022-08-25 13:44:51 -04:00
|
|
|
run:
|
|
|
|
name: "deploy to gh pages"
|
|
|
|
command: |
|
|
|
|
git config --global user.email $(git log --pretty=format:"%ae" -n1)
|
|
|
|
git config --global user.name $(git log --pretty=format:"%an" -n1)
|
|
|
|
npm run deploy -- -e $CIRCLE_BRANCH
|
2022-03-17 10:20:40 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-test:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- checkout
|
2022-08-25 13:44:51 -04:00
|
|
|
- *setup
|
|
|
|
- *lint
|
|
|
|
- *unit
|
|
|
|
- *build
|
2022-03-29 17:20:42 -04:00
|
|
|
- store_test_results:
|
|
|
|
path: test/results
|
2022-04-12 13:49:05 -04:00
|
|
|
build-test-deploy:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- checkout
|
2022-08-25 13:44:51 -04:00
|
|
|
- *setup
|
|
|
|
- *lint
|
|
|
|
- *unit
|
|
|
|
- *build
|
2022-04-12 13:49:05 -04:00
|
|
|
- store_test_results:
|
|
|
|
path: test/results
|
2022-08-25 13:44:51 -04:00
|
|
|
- *deploy-gh-pages
|
2022-08-26 12:19:43 -04:00
|
|
|
- run:
|
|
|
|
command: npx semantic-release
|
|
|
|
environment:
|
|
|
|
HUSKY: 0 # disable Husky hooks so commitlint doesn't block semantic-release
|
2022-04-22 10:23:30 -04:00
|
|
|
push-translations:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- checkout
|
2022-08-25 13:44:51 -04:00
|
|
|
- *setup
|
2022-04-22 10:23:30 -04:00
|
|
|
- run:
|
|
|
|
name: "run i18n script"
|
|
|
|
command: |
|
|
|
|
npm run i18n:src
|
|
|
|
npm run i18n:push
|
2022-03-17 10:20:40 -04:00
|
|
|
|
|
|
|
workflows:
|
2022-08-25 17:53:06 -04:00
|
|
|
commitlint:
|
|
|
|
jobs:
|
|
|
|
- commitlint/lint:
|
|
|
|
target-branch: develop
|
2022-03-17 10:20:40 -04:00
|
|
|
build-test-no-deploy:
|
|
|
|
jobs:
|
|
|
|
- build-test:
|
2022-03-29 13:36:11 -04:00
|
|
|
context:
|
|
|
|
- dockerhub-credentials
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- master
|
|
|
|
- develop
|
|
|
|
- /^hotfix\/.*/
|
2022-04-19 15:46:19 -04:00
|
|
|
- gh-pages
|
2022-04-12 13:49:05 -04:00
|
|
|
build-test-deploy:
|
|
|
|
jobs:
|
|
|
|
- build-test-deploy:
|
|
|
|
context:
|
|
|
|
- dockerhub-credentials
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- develop
|
|
|
|
- /^hotfix\/.*/
|
2022-04-22 10:23:30 -04:00
|
|
|
push-translations:
|
|
|
|
triggers:
|
|
|
|
- schedule:
|
|
|
|
cron: 0 0 * * * # daily at 12 UTC, 8 ET
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- develop
|
|
|
|
jobs:
|
|
|
|
- push-translations:
|
|
|
|
context:
|
|
|
|
- dockerhub-credentials
|