name: Deploy the dev documentation
on:
  push:
    paths:
      - 'docs/**'
      - mkdocs.yml
    branches:
      - main
jobs:
  deploy:
    name: Deploy the dev documentation
    runs-on: ubuntu-22.04
    steps:
      - name: Checkout main
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          fetch-depth: 0
          persist-credentials: true
      - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
        with:
          python-version: 3.x
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip setuptools wheel
          pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git@9.5.44-insiders-4.53.14
          pip install -r docs/build/requirements.txt
        env:
          GH_TOKEN: ${{ secrets.MKDOCS_AQUA_BOT }}
      - name: Configure the git user
        run: |
          git config user.name "knqyf263"
          git config user.email "knqyf263@gmail.com"
      - name: Deploy the dev documents
        run: mike deploy --push dev
