-
Notifications
You must be signed in to change notification settings - Fork 2.3k
95 lines (82 loc) · 2.74 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
95 lines (82 loc) · 2.74 KB
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
name: Publish Docs
on:
schedule:
- cron: "0 13 * * *"
pull_request:
push:
branches:
- main
release:
types:
- published
permissions:
# Give the GITHUB_TOKEN write permission to open a PR with the changes to the switcher.json file.
contents: write
pull-requests: write
jobs:
run:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
env:
REF_NAME: ${{ github.ref_name }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Micromamba env
uses: mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 # v3.0.0
with:
environment-name: TEST
init-shell: bash
create-args: >-
python=3
--file requirements.txt
--file requirements-dev.txt
- name: Install folium from source
run: python -m pip install -e . --no-deps --force-reinstall
- name: Build documentation
run: |
set -e
pushd docs
make clean html linkcheck
popd
- name: Update switcher and latest version
if: ${{ github.event_name == 'release' }}
run: |
python docs/update_switcher.py --version $REF_NAME
- name: Create PR
if: ${{ github.event_name == 'release' }}
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
commit-message: "docs: Update switcher.json for $REF_NAME"
title: "docs: Update switcher.json for $REF_NAME"
body: "This PR updates the switcher.json file."
branch: "docs/update-switcher-$REF_NAME"
base: "main"
labels: "documentation"
- name: Publish to Github Pages on main
if: ${{ github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html/
destination_dir: dev
keep_files: false
- name: Publish to Github Pages on release (versioned)
if: ${{ github.event_name == 'release' }}
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html/
destination_dir: $REF_NAME
- name: Publish to Github Pages on release (latest)
if: ${{ github.event_name == 'release' }}
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html/
destination_dir: latest
keep_files: false