forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (63 loc) · 2.54 KB
/
docbuild-and-upload.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
name: Doc Build and Upload
on:
push:
branches:
- master
- 1.4.x
pull_request:
branches:
- master
- 1.4.x
env:
ENV_FILE: environment.yml
PANDAS_CI: 1
jobs:
web_and_docs:
name: Doc Build and Upload
runs-on: ubuntu-latest
concurrency:
# https://github.community/t/concurrecy-not-work-for-push/183068/7
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-web-docs
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up pandas
uses: ./.github/actions/setup
- name: Build website
run: |
source activate pandas-dev
python web/pandas_web.py web/pandas --target-path=web/build
- name: Build documentation
run: |
source activate pandas-dev
doc/make.py --warnings-are-errors | tee sphinx.log ; exit ${PIPESTATUS[0]}
# This can be removed when the ipython directive fails when there are errors,
# including the `tee sphinx.log` in te previous step (https://github.com/ipython/ipython/issues/11547)
- name: Check ipython directive errors
run: "! grep -B10 \"^<<<-------------------------------------------------------------------------$\" sphinx.log"
- name: Install ssh key
run: |
mkdir -m 700 -p ~/.ssh
echo "${{ secrets.server_ssh_key }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo "${{ secrets.server_ip }} ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBE1Kkopomm7FHG5enATf7SgnpICZ4W2bw+Ho+afqin+w7sMcrsa0je7sbztFAV8YchDkiBKnWTG4cRT+KZgZCaY=" > ~/.ssh/known_hosts
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/master'}}
- name: Copy cheatsheets into site directory
run: cp doc/cheatsheet/Pandas_Cheat_Sheet* web/build/
- name: Upload web
run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' web/build/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/master'}}
- name: Upload dev docs
run: rsync -az --delete doc/build/html/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas/pandas-docs/dev
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/master'}}
- name: Move docs into site directory
run: mv doc/build/html web/build/docs
- name: Save website as an artifact
uses: actions/upload-artifact@v2
with:
name: website
path: web/build
retention-days: 14