Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save TheMagoo73/d6b6bb5917c070549bc865fe56def96c to your computer and use it in GitHub Desktop.
Save TheMagoo73/d6b6bb5917c070549bc865fe56def96c to your computer and use it in GitHub Desktop.
Polymer 3 element CI/CD configuration for Circle CI (maybe...)
version: 2
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:7.10
jobs:
prequisites:
<<: *defaults
steps:
- run: npm install -g polymer-cli
test:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run:
name: Install dependancies
command: npm install
- run:
name: Run tests
command: polymer test
- save_cache:
paths:
- node_modules
key: v1=dependencies-{{ checksum "package.jsone" }}
- persist_to_workspace:
root: ~/repo
paths: .
deploy_beta:
<< *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Authenticate with NPM
command: echo "//registry,npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
-run:
name: Publish beta package
command: npm publish --tag beta
deploy:
<< *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Authenticate with NPM
command: echo "//registry,npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
-run:
name: Publish package
command: npm publish
workflows:
version: 2
test-deploy-beta:
jobs:
- prequisites:
filters:
tags:
only: /^v.*-beta*/
- test:
requires:
- prequisites
filters:
tags:
only: /^v.*-beta*/
- deploy-beta:
requires:
- test
filters:
tags:
only: /^v.*-beta*/
test-deploy:
jobs:
- prequisites:
filters:
tags:
only: /^v.*/
- test:
requires:
- prequisites
filters:
tags:
only: /^v.*/
- deploy:
requires:
- test
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment