name: Deploy to Github Pages

on:
  push:
    branches: [ "main" ]
  workflow_dispatch:

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      
      - name: Install poetry
        run: pipx install poetry
      
      - name: Setup Python
        uses: actions/setup-python@v3.1.3
        with:
          python-version: '3.x'
          cache: poetry
      
      - name: Install dependencies
        run: poetry install
      
      - name: Run gh-deploy
        run: poetry run mkdocs gh-deploy --force