forked from move-coop/parsons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
95 lines (90 loc) · 3.2 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
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2
workflows:
version: 2
build:
jobs:
- docs-build
- docs-build-deploy:
filters:
branches:
only: main
jobs:
# Documentation CI
docs-build:
docker:
- image: cimg/python:3.10
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v2-dependencies-python3.10-{{ checksum "./docs/requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v2-dependencies-python3.10-
- run:
name: Install dependencies
# Note that we the circleci node image installs stuff with a user "circleci", rather
# than root. So we need to tell npm where to install stuff.
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r ./docs/requirements.txt
- save_cache:
paths:
- ./venv
key: v2-dependencies-python3.10-{{ checksum "./docs/requirements.txt" }}
- run:
name: Build docs
command: |
. venv/bin/activate
cd docs/
make deploy_docs
cd ..
docs-build-deploy:
docker:
- image: cimg/python:3.10-node
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v2-dependencies-python3.10-{{ checksum "./docs/requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v2-dependencies-python3.10-
- run:
name: Install dependencies
# Note that we the circleci node image installs stuff with a user "circleci", rather
# than root. So we need to tell npm where to install stuff.
command: |
npm set prefix=/home/circleci/npm
npm install -g --silent [email protected]
python3 -m venv venv
. venv/bin/activate
pip install -r ./docs/requirements.txt
- save_cache:
paths:
- ./venv
key: v2-dependencies-python3.10-{{ checksum "./docs/requirements.txt" }}
- add_ssh_keys:
# This SSH key is "CircleCI Docs" in https://github.com/move-coop/parsons/settings/keys
# We need write access to the Parsons repo, so we can push the "gh-pages" branch.
fingerprints:
- '9a:ec:4d:2b:c3:45:b2:f5:55:ca:0b:2b:36:e2:7f:df'
- run:
name: Build and deploy docs
# When running gh-pages, we specify to include dotfiles, so we pick up the .nojerkyll file.
# (This file tell Github Pages that we want to include all files in docs/, including those
# that start with an underscore like _static/).
command: |
. venv/bin/activate
cd docs/
make deploy_docs
cd ..
git config user.email "[email protected]"
git config user.name "ci-build"
export PATH=/home/circleci/npm/bin:$PATH
gh-pages --dotfiles --message "[skip ci] Updates" --dist docs