1
+ version : 2.1
2
+
3
+ orbs :
4
+ python : circleci/python@0.2.1
5
+
6
+ workflows :
7
+ default_workflow :
8
+ jobs :
9
+ - build :
10
+ filters :
11
+ branches :
12
+ only :
13
+ - master
14
+
15
+ jobs :
16
+ build :
17
+ docker :
18
+ # specify the version you desire here
19
+ # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
20
+ - image : circleci/python:3.7
21
+
22
+ # Specify service dependencies here if necessary
23
+ # CircleCI maintains a library of pre-built images
24
+ # documented at https://circleci.com/docs/2.0/circleci-images/
25
+ # - image: circleci/postgres:9.4
26
+
27
+ working_directory : ~/repo
28
+
29
+ steps :
30
+ - checkout
31
+
32
+ # Download and cache dependencies
33
+ - restore_cache :
34
+ keys :
35
+ - v1-dependencies-{{ checksum "requirements.txt" }}
36
+ # fallback to using the latest cache if no exact match is found
37
+ - v1-dependencies-
38
+
39
+ - run :
40
+ name : install dependencies
41
+ command : |
42
+ python3 -m venv venv
43
+ . venv/bin/activate
44
+ pip install --upgrade pip && pip install -r requirements.txt
45
+
46
+ - save_cache :
47
+ paths :
48
+ - ./venv
49
+ key : v1-dependencies-{{ checksum "requirements.txt" }}
50
+
51
+ # run tests!
52
+ # this example uses Django's built-in test-runner
53
+ # other common Python testing frameworks include pytest and nose
54
+ # https://pytest.org
55
+ # https://nose.readthedocs.io
56
+ - deploy :
57
+ name : " Deploy docs"
58
+ command : |
59
+ git clone --branch=master --depth=1 "https://$USER_NAME:$GITHUB_TOKEN@github.com/$USER_NAME/$CIRCLE_PROJECT_REPONAME.git" deploy && cd deploy
60
+ git clone --branch=gh-pages --depth=1 "https://$USER_NAME:$GITHUB_TOKEN@github.com/$USER_NAME/$CIRCLE_PROJECT_REPONAME.git" site
61
+ . ../venv/bin/activate
62
+ mkdocs build
63
+ cd site
64
+ git config user.name "$USER_NAME"
65
+ git config user.email "$USER_EMAIL"
66
+ git add --all
67
+ git commit -m "Deploy $CIRCLE_BUILD_NUM from CircleCI [skip ci]"
68
+ git push origin gh-pages
0 commit comments