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 }}