haystack/.github/workflows/update_docsstrings_tutorials.yml
Sara Zan 713771095b
Autogenerate OpenAPI specs file (#2047)
* Add docstrings to the REST API endpoint to have them included in the OpenAPI specs

* Attempt at make GitHub CI generate the OpenAPI specs

* Missing __init__.py was breaking rest_api import

* Add comment on dummy pipeline

* Create separate workflow file for the OpenAPI specs generation

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Markus Paff <markuspaff.mp@gmail.com>
2022-01-27 13:06:01 +01:00

57 lines
1.8 KiB
YAML

name: Update Docstrings and Tutorials
# Controls when the action will run. Triggers the workflow on push
# events but only for the master branch
on:
push:
branches-ignore:
- master
- benchmarks
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Set up Python 3.8.10
uses: actions/setup-python@v2
with:
python-version: 3.8.10
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pydoc-markdown==3.11.0
pip install mkdocs
pip install jupytercontrib
pip install watchdog==1.0.2
# Generates the docstrings and tutorials so that we have the latest for the deployment
- name: Generate Docstrings and Tutorials
run: |
cd docs/_src/api/api/
./generate_docstrings.sh
cd ../../tutorials/tutorials/
python3 convert_ipynb.py
cd ../../../../
git status
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Add latest docstring and tutorial changes" -a || echo "No changes to commit"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}