Skip to content

Commit 5bc01a5

Browse files
committed
CI: Migrating to CircleCI 2.x
1 parent 5959c55 commit 5bc01a5

File tree

2 files changed

+77
-19
lines changed

2 files changed

+77
-19
lines changed

.circleci/config.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: circleci/node:9.7.1-stretch-browsers
6+
steps:
7+
- checkout
8+
9+
# Restore our dependency cache
10+
- restore_cache:
11+
keys:
12+
- node-cache-{{ checksum "package.json" }}
13+
- node_cache-
14+
15+
# Execute the build process
16+
- run:
17+
name: Fetch and Install packages
18+
command: yarn
19+
20+
- save_cache:
21+
paths:
22+
- node_modules
23+
key: node-cache-{{ checksum "package.json" }}
24+
25+
- run:
26+
name: Create optimized production build
27+
command: yarn build
28+
29+
# Execute the packaging process
30+
- run:
31+
name: Emit build number
32+
command: echo "{\"version\":$CIRCLE_BUILD_NUM}" >> build/build.json
33+
- run:
34+
name: Create the zip file
35+
command: cd build; zip -r9 /tmp/centralconfig-ui.zip .
36+
37+
# Indicate we have artifacts
38+
- store_artifacts:
39+
path: /tmp/centralconfig-ui.zip
40+
41+
# Persist the built (unzipped) app to the workspace
42+
- persist_to_workspace:
43+
root: .
44+
paths:
45+
- build
46+
47+
# Persist the zip artifact to the workspace
48+
- persist_to_workspace:
49+
root: /tmp
50+
paths:
51+
- centralconfig-ui.zip
52+
53+
release:
54+
docker:
55+
- image: circleci/golang:1.9.4
56+
steps:
57+
- attach_workspace:
58+
at: /tmp/workspace
59+
60+
- run:
61+
name: Fetch and Install packages
62+
command: go get github.com/tcnksm/ghr
63+
64+
- run:
65+
name: Push the release to Github
66+
command: ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME v1.0.$CIRCLE_BUILD_NUM /tmp/workspace/centralconfig-ui.zip || true
67+
68+
workflows:
69+
version: 2
70+
71+
# Build and deploy workflow
72+
build_deploy:
73+
jobs:
74+
- build
75+
- release:
76+
requires:
77+
- build

circle.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)