Update doxygen.yaml #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: Generate and Publish Doxygen | |
on: | |
push: | |
branches: | |
- main # ou votre branche par défaut | |
pull_request: | |
branches: | |
- main # ou votre branche par défaut | |
jobs: | |
generate-docs: | |
runs-on: ubuntu-latest | |
if: github.actor != 'github-actions[bot]' | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive # Si votre projet utilise des submodules | |
- name: Install Doxygen | |
run: sudo apt-get install doxygen | |
- name: Generate Doxygen Documentation | |
uses: mattnotmitt/doxygen-action@v1.9.5 | |
with: | |
doxyfile-path: 'Doxyfile' # Assurez-vous que le Doxyfile est à la racine du projet | |
- name: Create /docs directory if not exists | |
run: mkdir -p ${{ github.workspace }}/docs | |
- name: Commit Documentation | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add docs/ | |
git commit -m "Update documentation" -a || echo "No changes to commit" | |
- name: Push Changes | |
uses: ad-m/github-push-action@v0.6.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
force: true | |
directory: ${{ github.workspace }}/docs | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/main' # Cette étape s'exécute uniquement sur la branche principale | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/html # Assurez-vous que c'est le répertoire de sortie configuré dans Doxyfile |