Skip to content

Update static.yml

Update static.yml #4

Workflow file for this run

# .github/workflows/deploy-docs.yml
name: Deploy Doxygen Docs to GitHub Pages
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write # Grant write access to contents
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main # Check out the main branch
- name: Install Doxygen
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages # Check out into a subdirectory
- name: Copy Doxyfile to Working Directory
run: |
# Copy Doxyfile from gh-pages to the current working directory
cp gh-pages/Doxyfile .
- name: Generate Doxygen Documentation
run: |
# Run Doxygen to generate docs (adjust command if necessary)
doxygen Doxyfile
- name: Copy docs to gh-pages branch
run: |
# Remove existing docs and copy the newly generated ones
rm -rf gh-pages/docs/*
cp -R docs/* gh-pages/docs/
- name: Commit and Push Changes
run: |
cd gh-pages
git config --local user.name "github-actions"
git config --local user.email "github-actions@github.com"
git add docs/
git commit -m "Update documentation" || echo "No changes to commit"
git push origin gh-pages