name: Github Pages on: push: branches: - main - beta paths: - '.github/workflows/pages.yml' - 'docs/**' env: # Publish the main documentation in 'docs/main' folder, and the beta in 'docs/beta' # Routing and version selection is handled in the main documentation. DESTINATION_DIR: ${{ github.ref == 'refs/heads/main' && 'docs/main' || 'docs/beta' }} jobs: release: name: Release runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 persist-credentials: false - name: Deploy index.html uses: peaceiris/actions-gh-pages@v4 if: github.ref == 'refs/heads/main' with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs destination_dir: docs # Subfolders docs/main and docs/beta will contain the actual versioned documentation. # This is just to have the rooting properly done at the root. keep_files: true - name: Deploy versioned documentation uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs destination_dir: ${{ env.DESTINATION_DIR }} keep_files: false