Merge pull request #23 from irisalmeida/front-back-integration #4
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: Generate Docs | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'registraai/*.py' | |
workflow_dispatch: | |
jobs: | |
generate-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10.*' | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Generate documentation | |
run: | | |
export PYTHONPATH="./registraai/:$PYTHONPATH" | |
lazydocs registraai | |
- name: Check for changes in docs | |
id: check_changes | |
run: | | |
if [ -n "$(git status --porcelain docs/)" ]; then | |
echo "changes=true" >> $GITHUB_ENV | |
else | |
echo "changes=false" >> $GITHUB_ENV | |
fi | |
- name: Commit and push changes | |
if: env.changes == 'true' | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add docs/ | |
git commit -m "Update documentation" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |