Skip to content

Commit

Permalink
Fix doxygen deployment (#481)
Browse files Browse the repository at this point in the history
* Use normal push

* use gh pages

* use gh pages

* use gh pages

* use gh pages

* use gh pages
  • Loading branch information
tony-josi-aws authored Nov 20, 2024
1 parent 725bf7b commit ca335f9
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,26 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Switch to gh-pages branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
# Check if the gh-pages branch exists. If not, create it.
branch_exist=$(git ls-remote --heads origin gh-pages)
if [ -z ${branch_exist} ]; then
git checkout --orphan gh-pages
git reset --hard
git commit --allow-empty -m "Created gh-pages branch"
git push origin gh-pages
fi
# Switch to gh-pages branch
git fetch
git checkout gh-pages
- name: Create local changes
run: |
sudo apt-get install doxygen
Expand All @@ -24,14 +40,16 @@ jobs:
cp -r ./html/* ./
rm -rf ./html
git add .
- name: Commit files
- name: Commit and push files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Auto-generate Doxygen documentation via Github Actions" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true
git config --global user.name ${{ github.actor }}
git config --global user.email ${{ github.actor }}@users.noreply.github.com
git add .
# Only commit if doxygen is changed.
changed=$(git diff-index HEAD)
if [ -n "$changed" ]; then
git commit -m "Auto-generate Doxygen documentation via Github Actions" -a
git push origin gh-pages
fi

0 comments on commit ca335f9

Please sign in to comment.