diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 25bb924922..2a00f15f41 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -20,7 +20,7 @@ jobs: build-jekyll: runs-on: ubuntu-latest steps: - - name: Checkout gh-pages + - name: Checkout uses: actions/checkout@v4 with: ref: gh-pages @@ -57,26 +57,37 @@ jobs: - name: Generate Doxygen Documentation run: | branches=("master:core" "duo" "handle" "orbit" "gloves" "desktop" "spark" "chromadeck") + rm -rf docs || true + mkdir -p docs # Ensure the docs directory is clean and prepared for item in "${branches[@]}"; do IFS=':' read -r branch dest <<< "$item" dest="${dest:-$branch}" - # Ensure the output directory exists - mkdir -p docs/$dest + # Create a worktree for the branch in a separate directory + echo "Setting up worktree for branch: $branch" + git worktree add worktree/$branch $branch + + # Change directory to the worktree + cd worktree/$branch - # Checkout each branch and generate documentation - echo "Checking out branch: $branch" - git checkout $branch + # Ensure the output directory exists + mkdir -p ../../docs/$dest # Change OUTPUT_DIRECTORY in Doxyfile for each branch echo "Adjusting Doxyfile for branch: $branch" - sed -i "s|OUTPUT_DIRECTORY *=.*|OUTPUT_DIRECTORY = docs/$dest|" Doxyfile + sed -i "s|OUTPUT_DIRECTORY *=.*|OUTPUT_DIRECTORY = ../../docs/$dest|" Doxyfile echo "Running Doxygen for branch: $branch" doxygen Doxyfile || { echo "Doxygen failed for branch: $branch"; exit 1; } echo "Generated docs for $branch in docs/$dest" + + # Return to the root directory + cd ../.. + + # Remove the worktree after processing + git worktree remove worktree/$branch -f done - name: Upload Doxygen Docs