-
Notifications
You must be signed in to change notification settings - Fork 18
56 lines (56 loc) · 1.84 KB
/
auto_docs.yaml
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
name: Build and Deploy documentation
on:
push:
branches:
- master
jobs:
build-and-deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Cache pip
id: cache-dev-pip
uses: actions/cache@v4
with:
# This path is specific to Ubuntu
# path: ~/.cache/pip
path: ${{ env.pythonLocation}}
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}_${{ env.pythonLocation}}_pip_dev_v4_3.10_${{ hashFiles('requirements_dev.txt') }}
- name: Install dependencies
if: steps.cache-dev-pip.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Build Documentation
run: |
cd docs
make clean
make html
- name: Commit documentation changes
run: |
git clone https://github.com/cve-search/CveXplore.git --branch gh-pages --single-branch gh-pages
cp -r docs/_build/html/* gh-pages/
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
env:
DOC_BUILD: '{"DOC_BUILD": "YES"}'
DATASOURCE_TYPE: 'mysql'
DATASOURCE_PROTOCOL: 'mysql'
DATASOURCE_DBAPI: 'pymysql'
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}