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

Commit

Permalink
CircleCI v2 adjustments (part II) (#314)
Browse files Browse the repository at this point in the history
* Fix build step
* Fix artifacts
* Fix code-coverage and lint output file
* Fix lint
* Fix schema violations
* Fix workflow filters
* Force deploy after build
* Fix deploy
* Add comments in config.yml
* Add caching to deploy
* Remove working_directory path
* Update gh-pages:build script
* Update copy circleci command in gh-pages:build script
* Put back workflow
  • Loading branch information
jfcere authored and scote committed May 1, 2018
1 parent d3fcc4a commit b500210
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
34 changes: 25 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@ jobs:
build:
docker:
- image: circleci/node:8-browsers
working_directory: ~/lib
steps:
# Checkout the code from the branch into the working_directory
- checkout
# Restore local dependencies from cache
# Restore lib dependencies from cache
- restore_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
# Install project dependencies
key: lib-dependency-cache-{{ checksum "yarn.lock" }}
# Install lib dependencies
- run:
name: Install local dependencies
name: Install lib dependencies
command: yarn install --frozen-lockfile --no-progress
# Cache local dependencies if they don't exist
# Cache lib dependencies if they don't exist
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
key: lib-dependency-cache-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- ./node_modules
Expand Down Expand Up @@ -47,10 +46,27 @@ jobs:
steps:
# Checkout the code from the branch into the working_directory
- checkout
# Build and Deploy demo-app to Github Pages
# Restore demo-app dependencies from cache
- restore_cache:
key: demo-dependency-cache-{{ checksum "./demo-app/yarn.lock" }}
# Install demo-app dependencies
- run:
name: Install demo-app dependencies
command: cd demo-app && yarn install --frozen-lockfile --no-progress
# Cache local dependencies if they don't exist
- save_cache:
key: demo-dependency-cache-{{ checksum "./demo-app/yarn.lock" }}
paths:
- ~/.cache/yarn
- ./demo-app/node_modules
# Build demo-app
- run:
name: Build
command: cd demo-app && yarn gh-pages:build
# Deploy demo-app to Github Pages
- run:
name: Deploy to gh-pages
command: cd demo-app && yarn install && yarn gh-pages:deploy
command: cd demo-app && yarn gh-pages:deploy

workflows:
version: 2
Expand Down
3 changes: 2 additions & 1 deletion demo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"sync:mz": "rimraf node_modules/ng2-materialize && linklocal",
"test": "ng test --watch=false",
"test:watch": "ng test",
"gh-pages:deploy": "npm run build:prod -- --base-href /ng2-materialize/ && cp ../.circleci/config.yml ./dist && cp ./dist/index.html ./dist/404.html && angular-cli-ghpages --name=\"CircleCI\" --email=\"circleci@email.com\""
"gh-pages:build": "npm run build:prod -- --base-href /ng2-materialize/ && cp ./dist/index.html ./dist/404.html",
"gh-pages:deploy": "angular-cli-ghpages --name=\"CircleCI\" --email=\"circleci@email.com\" --no-silent"
},
"private": true,
"dependencies": {
Expand Down

0 comments on commit b500210

Please sign in to comment.