Nekmo/pip-rating

View on GitHub
.github/workflows/docs.yml

Summary

Maintainability
Test Coverage
name: Docs

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    permissions: write-all
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python 3.11
        uses: actions/setup-python@v2
        with:
          python-version: '3.11'
      - name: Install dev dependencies
        run: |
          python -m pip install --upgrade pip
          if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
      - name: Build docs
        run: |
          cd docs/
          make html
      - name: Publish docs
        run: |
          mv ./docs/_build /tmp/
          git config --global user.name 'Pip-rating docs'
          git config --global user.email 'contacto@nekmo.com'
          git checkout --orphan docs
          rm -rf * .gitignore .github
          mv /tmp/_build/html/* .
          touch .nojekyll
          git add --all
          git commit -am "Updated docs at $(date)" || echo "Already updated"
          git push --force origin docs