-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathconfig.yml
125 lines (116 loc) · 5.44 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
version: 2
jobs:
build:
branches:
ignore:
- gh-pages
docker:
# a packaged system that has the instructions for creating a running container.
- image: circleci/ruby:2.7.4
# actions that need to be taken to perform your job
steps:
- add_ssh_keys:
fingerprints:
- "dc:5f:39:48:00:b4:72:34:e1:d2:c4:e1:1f:d1:e2:ce" #plotlydocbot
- restore_cache:
keys:
- source-v1- #one time, not every time!
# checks out the source code for a job over SSH
- checkout
- save_cache:
key: source-v1-1 # Sept 7, 2019
paths:
- ".git"
- restore_cache:
keys:
- gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
- gem-cache-v1-{{ arch }}-{{ .Branch }}
- gem-cache-v1
- run:
name: install dependencies
command: |
gem install bundler:2.4.22
bundle install --path vendor/bundle
sudo rm /etc/apt/sources.list
echo "deb http://ftp.us.debian.org/debian/ bookworm main contrib non-free" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://ftp.us.debian.org/debian/ bookworm main contrib non-free" | sudo tee -a /etc/apt/sources.list
echo "Acquire::Check-Valid-Until false;" | sudo tee -a /etc/apt/apt.conf.d/10-nocheckvalid
echo '# Package: *\nPin: origin "archive.debian.org"\nPin-Priority: 500' | sudo tee -a /etc/apt/preferences.d/10-archive-pin
sudo apt-get update
sudo apt-get install python3-full python3-pip
python3 -m venv venv
source venv/bin/activate
pip install PyYAML==6.0.1
pip install python-frontmatter==0.5.0
pip install pathlib
- save_cache:
key: gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run:
name: deployment
command: |
source venv/bin/activate
git config --global user.email "accounts@plot.ly"
git config --global user.name "plotlydocbot"
echo
echo "token: ${mapbox_token}" > _data/mapbox_token.yml
make fetch_upstream_files
python front-matter-ci.py _posts
python check-or-enforce-order.py _posts/python
python check-or-enforce-order.py _posts/python-v3
python check-or-enforce-order.py _posts/r/
python check-or-enforce-order.py _posts/matlab
python check-or-enforce-order.py _posts/plotly_js
echo `md5 -q all_static/css/main.css` > _data/cache_bust_css.yml
deactivate
rm -rf venv
bundle exec jekyll build
rm _data/mapbox_token.yml
mkdir snapshots
cd _site
cp -r 'all_static' '../snapshots'
cp 'api/index.html' '../snapshots'
cp --parents 'python/index.html' '../snapshots'
cp --parents 'python/getting-started/index.html' '../snapshots'
cp --parents 'python/plotly-fundamentals/index.html' '../snapshots'
cp --parents 'python/line-and-scatter/index.html' '../snapshots'
cp --parents 'r/index.html' '../snapshots'
cp --parents 'r/getting-started/index.html' '../snapshots'
cp --parents 'r/plotly-fundamentals/index.html' '../snapshots'
cp --parents 'r/line-and-scatter/index.html' '../snapshots'
cp --parents 'javascript/index.html' '../snapshots'
cp --parents 'javascript/plotly-fundamentals/index.html' '../snapshots'
cp --parents 'javascript/getting-started/index.html' '../snapshots'
cp --parents 'javascript/line-and-scatter/index.html' '../snapshots'
cp --parents 'ggplot2/index.html' '../snapshots'
cp --parents 'ggplot2/getting-started/index.html' '../snapshots'
cp --parents 'ggplot2/histograms/index.html' '../snapshots'
cp --parents 'matlab/index.html' '../snapshots'
cp --parents 'matlab/getting-started/index.html' '../snapshots'
cp --parents 'matlab/graphing-multiple-chart-types/index.html' '../snapshots'
cp --parents 'matlab/histograms/index.html' '../snapshots'
cp --parents 'csharp/index.html' '../snapshots'
cp --parents 'csharp/getting-started/index.html' '../snapshots'
cd ..
rm -f 'snapshots/all_static/javascripts/jquery-knob/index.html'
rm -f 'snapshots/all_static/images/Plotly-feed2.html'
rm -f 'snapshots/all_static/images/Plotly.html'
rm -f 'snapshots/all_static/images/Plotly-Feed.html'
rm -f snapshots/*.bkp
rm -f snapshots/*/*.bkp
rm -f snapshots/*/*/*.bkp
bundle exec percy snapshot snapshots --enable_javascript
rm -rf 'snapshots/'
if [ "${CIRCLE_BRANCH}" == "master" ]; then
git clone --depth=1 --branch=gh-pages https://github.com/plotly/documentation.git
git config user.name plotlydocbot
git config user.email accounts@plot.ly
cp -r _site/* documentation
cd documentation
git add .
git commit -m "deploying https://github.com/plotly/graphing-library-docs/commit/${CIRCLE_SHA1}"
git push
cd ..
rm -rf documentation
fi