@sroussey/parse-address
Version:
US Street Address Parser
117 lines (108 loc) • 2.84 kB
YAML
version: 2
references:
container_config:
docker:
- image: cimg/node:18.16
working_directory: ~/node
jobs:
dependencies:
<<:
steps:
- checkout
- run: node --version
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Authenticate npm registry
command: echo -e "${ARTIFACTORY_REGISTRY_NAME}:_authToken=${ARTIFACTORY_WRITE_TOKEN}" > .npmrc
- run:
name: Install Dependencies
command: "[[ -d node_modules ]] || npm ci"
- save_cache:
paths:
- node_modules
key: dependencies-{{ checksum "package.json" }}
test:
<<:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Install Dependencies
command: "bash .circleci/npm-install-if-uncached.sh"
- run:
name: Unit tests
command: npm run test
build:
<<:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Install Dependencies
command: "bash .circleci/npm-install-if-uncached.sh"
- run:
name: Build project
command: npm run build
publish:
<<:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Install Dependencies
command: "bash .circleci/npm-install-if-uncached.sh"
- run:
name: Authenticate npm registry
command: echo -e "${ARTIFACTORY_REGISTRY_NAME}:_authToken=${ARTIFACTORY_WRITE_TOKEN}" > .npmrc
- run:
name: NPM publish
command: npm run publish-package none
workflows:
version: 2
default:
jobs:
- dependencies
- build:
requires:
- dependencies
- test:
requires:
- dependencies
release:
jobs:
- dependencies:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
- build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
requires:
- dependencies
- test:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
requires:
- dependencies
- publish:
context: prod-environment
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
requires:
- test
- build