This repository was archived by the owner on Jan 11, 2024. It is now read-only.
forked from noslouch/clicktocongress-ember
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcircle.yml
122 lines (111 loc) · 3.42 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
version: 2
jobs:
build:
docker:
- image: circleci/node:7.10.1
steps:
- checkout
- run:
name: update yarn
command: |
sudo apt-get install apt-transport-https
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn
- restore_cache:
key: grunt-and-bower
- run:
name: Install grunt and bower
command: /usr/bin/yarn global add bower grunt-cli --prefix ~/.config/yarn/global
- save_cache:
key: grunt-and-bower
paths:
- ~/.config/yarn/global
- restore_cache:
key: bower-deps-{{ checksum "bower.json" }}
- run:
name: Install bower deps
command: ~/.config/yarn/global/node_modules/.bin/bower i
- save_cache:
key: bower-deps-{{ checksum "bower.json" }}
paths:
- bower_components
- restore_cache:
key: node-deps-{{ checksum "yarn.lock" }}
- run:
name: Node dependencies
command: /usr/bin/yarn --pure-lockfile
- save_cache:
key: node-deps-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run:
name: Build modernizr
command: ~/.config/yarn/global/node_modules/.bin/grunt modernizr:dist
- save_cache:
key: modernizr-{{ .Revision }}
paths:
- vendor/modernizr/modernizr-build.js
test:
docker:
- image: circleci/node:8.10.0-browsers
environment:
JOBS: 2
steps:
- checkout
- restore_cache:
key: bower-deps-{{ checksum "bower.json" }}
- restore_cache:
key: node-deps-{{ checksum "yarn.lock" }}
- restore_cache:
key: modernizr-{{ .Revision }}
- run:
name: Test
command: ./node_modules/ember-cli/bin/ember test
deploy:
docker:
- image: circleci/node:8.10.0
environment:
JOBS: 2
steps:
- checkout
- restore_cache:
key: bower-deps-{{ checksum "bower.json" }}
- restore_cache:
key: node-deps-{{ checksum "yarn.lock" }}
- restore_cache:
key: modernizr-{{ .Revision }}
- run:
name: Ruby deps # ugh
command: |
sudo apt-get install ruby-sass
sudo gem update --system --no-ri --no-rdoc
sudo gem install compass --no-ri --no-rdoc
- run:
name: Deploy to S3
command: |
env | sed -n 's/^DEPLOY_//p' > .env
if [[ "${CIRCLE_BRANCH}" == "master" ]]; then
env | sed -n 's/^DEMO_//p' >> .env
./node_modules/ember-cli/bin/ember deploy demo --verbose --activate
elif grep -q "v[0-9]\+\.[0-9]\+\.[0-9]\+" <<< "$CIRCLE_TAG"; then
env | sed -n 's/^PROD_//p' >> .env
./node_modules/ember-cli/bin/ember deploy production --verbose --activate
fi
workflows:
version: 2
just-build-and-deploy:
jobs:
- build:
filters:
tags:
only: /.*/
- deploy:
requires:
- build
filters:
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+/
branches:
only: master