Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
add npm-publish-token context to circleci config
Browse files Browse the repository at this point in the history
  • Loading branch information
serena97 committed Mar 11, 2022
1 parent c601cdb commit fb41d56
Showing 1 changed file with 36 additions and 23 deletions.
59 changes: 36 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,63 @@

references:

container_config_node: &container_config_node
container_config_node:
&container_config_node
working_directory: ~/project/build
docker:
- image: cimg/node:12.22

workspace_root: &workspace_root
~/project
workspace_root: &workspace_root ~/project

attach_workspace: &attach_workspace
attach_workspace:
&attach_workspace
attach_workspace:
at: *workspace_root

npm_cache_keys: &npm_cache_keys
npm_cache_keys:
&npm_cache_keys
keys:
- v10-dependency-npm-{{ checksum "package.json" }}-
- v10-dependency-npm-{{ checksum "package.json" }}
- v10-dependency-npm-
- v10-dependency-npm-{{ checksum "package.json" }}-
- v10-dependency-npm-{{ checksum "package.json" }}
- v10-dependency-npm-

cache_npm_cache: &cache_npm_cache
cache_npm_cache:
&cache_npm_cache
save_cache:
key: v10-dependency-npm-{{ checksum "package.json" }}-{{ epoch }}
paths:
key: v10-dependency-npm-{{ checksum "package.json" }}-{{ epoch }}
paths:
- ./node_modules/

restore_npm_cache: &restore_npm_cache
restore_npm_cache:
&restore_npm_cache
restore_cache:
<<: *npm_cache_keys
<<: *npm_cache_keys

filters_only_main: &filters_only_main
filters_only_main:
&filters_only_main
branches:
only: main

filters_ignore_tags: &filters_ignore_tags
filters_ignore_tags:
&filters_ignore_tags
tags:
ignore: /.*/

filters_version_tag: &filters_version_tag
filters_version_tag:
&filters_version_tag
tags:
only:
- /^v?\d+\.\d+\.\d+(?:-beta\.\d+)?$/
branches:
ignore: /.*/

filters_only_renovate_nori: &filters_only_renovate_nori
filters_only_renovate_nori:
&filters_only_renovate_nori
branches:
only: /(^renovate-.*|^nori/.*)/

filters_ignore_tags_renovate_nori: &filters_ignore_tags_renovate_nori
filters_ignore_tags_renovate_nori:
&filters_ignore_tags_renovate_nori
tags:
ignore: /.*/
branches:
Expand All @@ -69,7 +78,9 @@ jobs:
- checkout
- run:
name: Checkout next-ci-shared-helpers
command: git clone --depth 1 git@github.com:Financial-Times/next-ci-shared-helpers.git .circleci/shared-helpers
command: git clone --depth 1
git@github.com:Financial-Times/next-ci-shared-helpers.git
.circleci/shared-helpers
- *restore_npm_cache
- node/install-npm:
version: "7"
Expand Down Expand Up @@ -112,7 +123,8 @@ jobs:
- run:
name: shared-helper / npm-store-auth-token
command: .circleci/shared-helpers/helper-npm-store-auth-token
- run: npx snyk monitor --org=customer-products --project-name=Financial-Times/n-heroku-tools
- run: npx snyk monitor --org=customer-products
--project-name=Financial-Times/n-heroku-tools
- run:
name: shared-helper / npm-version-and-publish-public
command: .circleci/shared-helpers/helper-npm-version-and-publish-public
Expand Down Expand Up @@ -141,6 +153,7 @@ workflows:
requires:
- build
- publish:
context: npm-publish-token
filters:
<<: *filters_version_tag
requires:
Expand All @@ -151,13 +164,13 @@ workflows:
- waiting-for-approval:
type: approval
filters:
<<: *filters_only_renovate_nori
<<: *filters_only_renovate_nori
- build:
requires:
- waiting-for-approval
- waiting-for-approval
- test:
requires:
- build
- build

nightly:
triggers:
Expand Down

0 comments on commit fb41d56

Please sign in to comment.