Skip to content

Fix python version variable in ci #159

Fix python version variable in ci

Fix python version variable in ci #159

name: Build and Deploy Documentation

Check failure on line 1 in .github/workflows/build-deploy-docs.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-deploy-docs.yml

Invalid workflow file

(Line: 27, Col: 27): Unrecognized named-value: 'PYTHON_VERSION'. Located at position 1 within expression: PYTHON_VERSION, (Line: 30, Col: 14): Unrecognized named-value: 'PYTHON_VERSION'. Located at position 1 within expression: PYTHON_VERSION
on:
push:
branches: [ main ]
tags:
- 'v[0-9]*.[0-9]*.[0-9]*'
env:
UV_NO_SYNC: 1
PYTHON_VERSION: 3.13
jobs:
build-deploy-doc:
name: Build & deploy doc
environment: prod-documentation
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ PYTHON_VERSION }}
- name: Install dependencies (default with full options & doc)
run: uv pip install --python-version=${{ PYTHON_VERSION }} '.[full]' --group doc
- name: Determine deployment folder
id: deploy_folder
run: |
echo "Determining deployment folder..."
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "Deploying to target ${{ github.ref_name }}"
echo "DEPLOY_DIR=${{ github.ref_name }}" >> $GITHUB_OUTPUT
echo "TORCHJD_VERSION=${{ github.ref_name }}" >> $GITHUB_OUTPUT
else
echo "Deploying to target latest"
echo "DEPLOY_DIR=latest" >> $GITHUB_OUTPUT
echo "TORCHJD_VERSION=main" >> $GITHUB_OUTPUT
fi
- name: Build Documentation
working-directory: docs
run: uv run make dirhtml
env:
TORCHJD_VERSION: ${{ steps.deploy_folder.outputs.TORCHJD_VERSION }}
- name: Deploy to DEPLOY_DIR of TorchJD/documentation
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.PROD_DOCUMENTATION_DEPLOY_KEY }}
publish_dir: docs/build/dirhtml
destination_dir: ${{ steps.deploy_folder.outputs.DEPLOY_DIR }}
external_repository: TorchJD/documentation
publish_branch: main
- name: Kill ssh-agent
# See: https://github.com/peaceiris/actions-gh-pages/issues/909
run: killall ssh-agent
- name: Deploy to stable of TorchJD/documentation
if: startsWith(github.ref, 'refs/tags/')
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.PROD_DOCUMENTATION_DEPLOY_KEY }}
publish_dir: docs/build/dirhtml
destination_dir: stable
external_repository: TorchJD/documentation
publish_branch: main
- name: Add documentation link to summary
run: |
echo "### 📄 [View Deployed Documentation](https://torchjd.github.io/documentation/${{ steps.deploy_folder.outputs.DEPLOY_DIR }})" >> $GITHUB_STEP_SUMMARY