forked from streamich/react-use
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
141 lines (136 loc) Β· 3.5 KB
/
config.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
version: 2
refs:
container: &container
docker:
- image: node:12.22.7
working_directory: ~/repo
steps:
- &Versions
run:
name: Versions
command: node -v && npm -v && yarn -v
- &CacheRestore
restore_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
- &Install
run:
name: Install Dependencies
command: yarn install --pure-lockfile
- &CacheSave
save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- &Build
run:
name: Build
command: yarn build
- &Build_Storybook
run:
name: Build Storybook
command: yarn storybook:build
- &Test
run:
name: Test
command: yarn test
- &Upload_Storybook
run:
name: Upload Storybook
command: yarn storybook:upload
- &Release
run:
name: Release
command: yarn release
- &Commit_Status_Storybook
run:
name: Post commit status for Storybook
command: |
npx cross-ci :run curl -H "'Authorization: token \${GITHUB_TOKEN}' -H 'Accept: application/vnd.github.v3+json'" \
"'https://api.github.com/repos/\${PROJECT_OWNER}/\${PROJECT_NAME}/statuses/$CIRCLE_SHA1'" -X POST \
-d "'{\"state\": \"success\", \"context\": \"Storybook\", \"description\": \"\${BUILD_VERSION}\", \"target_url\": \"https://$CIRCLE_BUILD_NUM-154950925-gh.circle-artifacts.com/0/root/repo/storybook-static/index.html\"}'"
jobs:
all:
<<: *container
steps:
- checkout
- *Versions
- *CacheRestore
- *Install
- *CacheSave
- *Build
- *Build_Storybook
- *Test
- store_artifacts:
path: ~/repo/storybook-static
- *Commit_Status_Storybook
next:
<<: *container
steps:
- checkout
- *Versions
- *CacheRestore
- *Install
- *CacheSave
- *Build
- *Build_Storybook
- *Test
- store_artifacts:
path: ~/repo/storybook-static
- *Commit_Status_Storybook
- run:
name: Setup GitHub
command: |
git config --global user.email "[email protected]"
git config --global user.name "streamich"
git remote rm origin
git remote add origin https://${GITHUB_TOKEN}@github.com/streamich/react-use
- *Release
master:
<<: *container
steps:
- checkout
- *Versions
- *CacheRestore
- *Install
- *CacheSave
- *Build
- *Build_Storybook
- *Test
- store_artifacts:
path: ~/repo/storybook-static
- *Commit_Status_Storybook
- run:
name: Setup GitHub
command: |
git config --global user.email "[email protected]"
git config --global user.name "streamich"
git remote rm origin
git remote add origin https://${GITHUB_TOKEN}@github.com/streamich/react-use
- *Upload_Storybook
- *Release
workflows:
version: 2
all:
jobs:
- all:
context: common-env-vars
filters:
branches:
ignore:
- master
- next
- gh-pages
next:
jobs:
- next:
context: common-env-vars
filters:
branches:
only: next
master:
jobs:
- master:
context: common-env-vars
filters:
branches:
only: master