fixed docs #246
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 Documentation | |
on: | |
push: | |
branches: | |
- gh-pages | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Install GitHub CLI | |
run: sudo apt-get install -y gh jq | |
- name: Download Doxygen Documentation Artifacts | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Set the GH_TOKEN environment variable | |
run: | | |
# Define branches with documentation to be included | |
branches=("core" "desktop" "gloves" "orbit" "handle" "duo" "chromadeck" "spark") | |
for branch in "${branches[@]}" | |
do | |
artifact_name="doxygen-docs-${branch}" | |
# Attempt to download each branch's artifact | |
echo "Attempting to download ${artifact_name}" | |
artifact_id=$(gh api -H "Accept: application/vnd.github+json" /repos/${{ github.repository }}/actions/artifacts | jq -r ".artifacts[] | select(.name==\"${artifact_name}\") | .id") | |
if [ -n "$artifact_id" ]; then | |
echo "Artifact ${artifact_name} exists, downloading..." | |
mkdir -p docs/${branch} | |
gh run download --name ${artifact_name} --dir docs/${branch} || echo "Failed to download artifact for branch: ${branch}" | |
else | |
echo "Artifact ${artifact_name} does not exist, skipping..." | |
fi | |
done | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./docs | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./_site | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |