-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f689b9f
commit 5ce038e
Showing
3 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# Javascript Node CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-javascript/ for more details | ||
# | ||
version: 2 | ||
|
||
defaults: &defaults | ||
docker: | ||
- image: circleci/node:10.16.3 | ||
working_directory: ~/vue-tour | ||
|
||
jobs: | ||
build: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
|
||
# install Cypress dependencies | ||
- run: sudo apt-get update && sudo apt-get install -y libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 xvfb | ||
|
||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v1-dependencies- | ||
|
||
- run: npm install | ||
|
||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }} | ||
|
||
# run unit tests! | ||
- run: npm run test:unit | ||
- run: npm run build | ||
|
||
- run: git worktree add ../vue-tour-landing origin/landing | ||
|
||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "../vue-tour-landing/package.json" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v1-dependencies- | ||
- | ||
- run: | ||
command: npm install | ||
working_directory: ~/vue-tour-landing | ||
|
||
- save_cache: | ||
paths: | ||
- ../vue-tour-landing/node_modules | ||
key: v1-dependencies-{{ checksum "../vue-tour-landing/package.json" }} | ||
|
||
# run e2e tests! | ||
- run: | ||
command: npm run test:e2e -- --headless | ||
working_directory: ~/vue-tour-landing | ||
|
||
- persist_to_workspace: | ||
root: ~/ | ||
paths: | ||
- vue-tour | ||
- vue-tour-landing | ||
|
||
publish: | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/ | ||
|
||
- add_ssh_keys: | ||
fingerprints: | ||
- "eb:09:ae:75:b5:8e:66:63:27:9a:c0:cb:64:6e:79:d5" | ||
|
||
# generate a new landing build and commit it to the gh-pages branch | ||
- run: | ||
command: npm run build | ||
working_directory: ~/vue-tour-landing | ||
|
||
- run: | ||
command: cp -R ./dist ../ | ||
working_directory: ~/vue-tour-landing | ||
|
||
- run: | ||
command: | | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
git checkout --track origin/gh-pages | ||
rm -rf * | ||
cp -R ../dist/. ./ | ||
git config user.email "[email protected]" | ||
git config user.name "Mathieu Morainville" | ||
git status | ||
git add . | ||
git commit -m "chore(ci): generate a new build" | ||
git push origin gh-pages | ||
working_directory: ~/vue-tour-landing | ||
|
||
# we could use standard-version here to generating a changelog, bump the version with a tag and commit it | ||
|
||
- run: | ||
name: Authenticate with registry | ||
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc | ||
when: always | ||
|
||
- run: | ||
name: Publish package | ||
command: cat .npmrc | ||
# command: npm publish | ||
|
||
# use workflows to publish only on tagged commits (see: https://circleci.com/blog/publishing-npm-packages-using-circleci-2-0/) | ||
workflows: | ||
version: 2 | ||
build-publish: | ||
jobs: | ||
- build: | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- staging | ||
- publish: | ||
requires: | ||
- build | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
branches: | ||
only: | ||
- master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,5 @@ yarn-error.log* | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
.npmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters