name: CI - Master

on:
  push:
    branches:
    - master

jobs:
  documentation:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - uses: actions/setup-python@v2
      with:
        python-version: "3.8"

    - name: Install Poetry
      run: python -m pip install poetry poetry-dynamic-versioning

    - uses: actions/cache@v2
      name: Cache Poetry dependencies
      with:
        path: |
          ~/.cache
          ~/.local/share/virtualenvs/
        key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
        restore-keys: |
          ${{ runner.os }}-poetry-

    - name: Get dependencies
      run: poetry install

    - name: Documentation
      run: make html
      working-directory: ./doc

    - name: Deploy to GitHub Pages
      uses: peaceiris/actions-gh-pages@v3
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        publish_dir: ./doc/_build/html
        destination_dir: ./api

name: CI - Master

on:
  push:
    branches:
    - master

jobs:
  documentation:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - uses: actions/setup-python@v2
      with:
        python-version: "3.8"

    - name: Install Poetry
      run: python -m pip install poetry poetry-dynamic-versioning

    - uses: actions/cache@v2
      name: Cache Poetry dependencies
      with:
        path: |
          ~/.cache
          ~/.local/share/virtualenvs/
        key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
        restore-keys: |
          ${{ runner.os }}-poetry-

    - name: Get dependencies
      run: poetry install

    - name: Documentation
      run: poetry run make html
      working-directory: ./doc

    - name: Deploy to GitHub Pages
      uses: peaceiris/actions-gh-pages@v3
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        publish_dir: ./doc/_build/html
        destination_dir: ./api

Make documentation on a poetry shell
ci: Make documentation on a poetry shell
