Morebetterplusgooddocumentation #27
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 Documentation to GitHub Pages | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup directories | |
run: | | |
mkdir main | |
mkdir gh-pages | |
- name: Checkout main branch | |
uses: actions/checkout@v2 | |
with: | |
path: 'main' | |
- name: Install Doxygen | |
run: sudo apt-get install doxygen | |
- name: Generate Documentation with Doxygen | |
run: | | |
cd main/doxygen | |
doxygen Doxyfile | |
cd ../.. | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@v2 | |
with: | |
ref: 'gh-pages' | |
path: 'gh-pages' | |
fetch-depth: 0 # Important to fetch all history for branch comparison | |
- name: Clear gh-pages branch content | |
run: | | |
cd gh-pages | |
git rm -rf . # Clear current contents safely | |
cd .. | |
- name: Copy Documentation to gh-pages directory | |
run: | | |
cp -r main/doxygen/html/* gh-pages/ | |
- name: Deploy to GitHub Pages | |
run: | | |
cd gh-pages | |
git config --global user.email "[email protected]" | |
git config --global user.name "Github Actions" | |
git add . | |
git commit -m "Deploy updated documentation" || echo "No changes to commit" | |
git push --force https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/ropg/OOKwiz.git gh-pages | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |