Skip to content

Deploy Documentation #18

Deploy Documentation

Deploy Documentation #18

Workflow file for this run

name: Deploy Documentation
on:
push:
branches:
- main
workflow_dispatch:
inputs:
branch:
description: 'Enter branch name to deploy from (default: main)'
required: false
type: string
default: 'main'
jobs:
deploy-docs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: doc
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch || 'main' }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Sphinx and dependencies
run: |
sudo apt-get install python3-sphinx
pip install -r requirements-doc.txt
pip install -r ../python/requirements.txt
- name: Get branch name
id: get-branch
run: echo "branch=$GITHUB_REF_NAME" >> $GITHUB_OUTPUT
- name: Build documentation
env:
READTHEDOCS_VERSION: ${{ steps.get-branch.outputs.branch != 'main' && 'releases/' + steps.get-branch.outputs.branch || 'main' }}

Check failure on line 44 in .github/workflows/deploy-docs.yaml

View workflow run for this annotation

GitHub Actions / Deploy Documentation

Invalid workflow file

The workflow is not valid. .github/workflows/deploy-docs.yaml (Line: 44, Col: 32): Unexpected symbol: '+'. Located at position 58 within expression: steps.get-branch.outputs.branch != 'main' && 'releases/' + steps.get-branch.outputs.branch || 'main'
run: make develop
- name: Prepare deployment directory
run: |
# Create the branch-specific directory (e.g., deploy/main)
mkdir -p ../deploy/${{ steps.get-branch.outputs.branch }}
rsync -av _build/html/ ../deploy/${{ steps.get-branch.outputs.branch }}/
# Create symlinks from root to the main directory (only for the main branch)
if [ "${{ steps.get-branch.outputs.branch }}" = "main" ]; then
cd ../deploy
ln -sfn main/* . # Symlink all files/dirs from main/ to root
ln -sfn main/.nojekyll . # Include hidden files if needed
fi
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./deploy
keep_files: true