/
config.yml
142 lines (142 loc) · 4.1 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
142
version: 2
jobs:
test:
docker:
- image: node:latest
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Install modules
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
- run:
name: Test
command: npm test
build:
docker:
- image: docker:latest
steps:
- run:
name: Git
command: apk add --update git
- checkout
- setup_remote_docker
- run:
name: Initialize submodule
command: git submodule update --init --remote
- run:
name: Build Docker image
command: if [ "$CIRCLE_BRANCH" = "master" ]; then docker build -t dougley/wildbeast:latest --build-arg buildno=$CIRCLE_BUILD_NUM --build-arg commitsha=$CIRCLE_SHA1 .; else docker build -t dougley/wildbeast:$CIRCLE_BRANCH --build-arg buildno=$CIRCLE_BUILD_NUM --build-arg commitsha=$CIRCLE_SHA1 .; fi
- run:
name: Push image to Docker hub
command: |
echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
if [ "$CIRCLE_BRANCH" = "master" ]; then docker push dougley/wildbeast:latest; else docker push dougley/wildbeast:$CIRCLE_BRANCH; fi
tagged-build:
docker:
- image: docker:latest
steps:
- run:
name: Git
command: apk add --update git
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Initialize submodule
command: git submodule update --init --remote
- run:
name: Build Docker image
command: docker build -t dougley/wildbeast:$(git describe --abbrev=0 --tags) --build-arg buildno=$CIRCLE_BUILD_NUM --build-arg commitsha=$CIRCLE_SHA1 .
- run:
name: Push image to Docker hub
command: |
echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
docker push dougley/wildbeast:$(git describe --abbrev=0 --tags)
docs-build:
docker:
- image: python:3.5
steps:
- checkout
- restore_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
- run:
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- save_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
paths:
- "venv"
- run:
name: Compile
command: |
. venv/bin/activate
mkdocs build
docs-deploy:
machine:
image: circleci/classic:latest
steps:
- checkout
- restore_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
- run:
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- save_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
paths:
- "venv"
- run:
name: Build JS
command: npm run build
- run:
name: Build docs
command: |
. venv/bin/activate
mkdocs build
- add_ssh_keys:
fingerprints:
- "cf:bd:5e:04:62:ce:4d:da:1e:11:87:a1:ab:3e:9f:df"
- run:
name: Deploy
command: |
. venv/bin/activate
git config user.email 9768134+Dougley@users.noreply.github.com
mkdocs gh-deploy
workflows:
version: 2
docs:
jobs:
- docs-build
- docs-deploy:
requires:
- docs-build
filters:
branches:
only: master
test_n_build:
jobs:
- test
- build:
requires:
- test
filters:
branches:
only: /master|experimental/
- tagged-build:
requires:
- test
filters:
branches:
ignore: /.*/
tags:
only: /v.+/