Mithil467/mitype

View on GitHub
.github/workflows/update_docs.yml

Summary

Maintainability
Test Coverage
name: Update docs on merge
on:
  push:
    branches: [master]

jobs:
  docs:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.8]

    steps:
      - uses: actions/checkout@v2
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install sphinx sphinx_rtd_theme
      - name: Build docs
        run: |
          sphinx-build ./docs/source ./build
      - name: Commit docs
        run: |
          git clone https://github.com/mithil467/mitype.git --branch gh-pages --single-branch gh-pages
          cp -r build/* gh-pages/
          cd gh-pages
          git config --local user.email "mithil467@gmail.com"
          git config --local user.name "Mithil Poojary"
          git add .
          git commit -m "Update documentation" -a || true
      - name: Push docs
        uses: ad-m/github-push-action@master
        with:
          branch: gh-pages
          directory: gh-pages
          github_token: ${{ secrets.TOKEN }}