adopted fix as suggested in cve-search/cve-seach#1106 #301
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |