This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy Jekyll and Doxygen Documentation | |
on: | |
push: | |
branches: | |
- gh-pages | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
# Build Jekyll Site | |
build-jekyll: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./ | |
destination: ./_site | |
- name: Upload Jekyll Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./_site | |
# Generate Doxygen Documentation | |
build-doxygen: | |
runs-on: ubuntu-latest | |
needs: build-jekyll | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Doxygen and Dependencies | |
run: sudo apt-get update && sudo apt-get install -y doxygen graphviz texlive | |
- name: Generate Doxygen Documentation | |
run: | | |
branches=("master:core" "duo" "handle" "orbit" "gloves" "desktop" "spark" "chromadeck") | |
rm -rf docs || true | |
for item in "${branches[@]}"; do | |
IFS=':' read -r branch dest <<< "$item" | |
dest="${dest:-$branch}" | |
# Checkout each branch and generate documentation | |
echo "Checking out branch: $branch" | |
git checkout $branch | |
echo "Running Doxygen for branch: $branch" | |
doxygen Doxyfile || { echo "Doxygen failed for branch: $branch"; exit 1; } | |
echo "Contents of docs directory after Doxygen generation:" | |
ls -l docs/ | |
# Move generated files to the correct directory | |
echo "Moving documentation for $branch to docs/$dest" | |
mkdir -p docs/$dest | |
mv -v docs/* docs/$dest/ || { echo "Move failed for branch: $branch"; exit 1; } | |
# Clean up to prepare for the next branch | |
rm -rf docs/* | |
echo "Generated docs for $branch, deployed to docs/$dest" | |
done | |
- name: Upload Doxygen Docs | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./docs | |
# Deploy to GitHub Pages | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [build-jekyll, build-doxygen] | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-pages-artifact@v2 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |