name: Dev Docs Publish
on:
  workflow_dispatch:
  push:
    branches: [ main ]

jobs:
  deploy:
    if: github.repository_owner == 'Qiskit-Community'
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
      with:
        fetch-depth: 0
    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        python-version: '3.12'
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -U virtualenv setuptools wheel tox
        sudo apt-get install graphviz pandoc
    - name: Build docs dev
      run: EXPERIMENTS_DEV_DOCS=1 PROD_BUILD=1 RELEASE_STRING=`git describe` tox -edocs
    - name: Bypass Jekyll Processing # Necessary for setting the correct css path
      run: touch docs/_build/html/.nojekyll
    - name: Deploy
      uses: JamesIves/github-pages-deploy-action@v4
      with:
        folder: docs/_build/html/
        target-folder: dev/