Skip to content

Update main.yml

Update main.yml #31

Workflow file for this run

name: Generate Documentation
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
generate_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Docsible
run: |
pip install git+https://github.com/docsible/docsible.git
- name: Generate documentation for role
run: |
docsible -r ./ -g -o README.md -com -nob
- name: Check for documentation changes
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
if git diff --cached --exit-code; then
echo "No changes to commit";
else
git commit -m "Automated documentation update by GitHub Actions"
git push "https://${TOKEN}@github.com/docsible/thermo-core.git" HEAD:main
fi