Merge pull request #7 from avaneesh2001/develop #11
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: 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: Prepare docs directory | |
run: | | |
# Create the docs directory if it doesn't exist | |
mkdir -p gh-pages/docs | |
- name: Copy docs to gh-pages branch | |
run: | | |
# Remove existing docs and copy the newly generated ones | |
rm -rf gh-pages/docs/* | |
mkdir -p gh-pages/docs | |
cp -R Docs/html/* gh-pages/docs/ # Ensure the target path is correct | |
- 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 |