Skip to content

Commit

Permalink
[github-ci] CI 新增构建测试通过后生成 Doxygen 文档并上传至文档仓库的功能
Browse files Browse the repository at this point in the history
  • Loading branch information
WentsingNee committed Apr 15, 2024
1 parent d59649e commit beb9d42
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/KerbalBuildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,60 @@ jobs:
with:
name: Kerbal-${{github.sha}}-${{matrix.platform}}
path: ${{github.workspace}}/Kerbal-pack/packages

update-doc:
if: github.ref_name == 'main'
continue-on-error: false
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest

runs-on: ${{matrix.os}}
needs: build

steps:

- name: Clone Kerbal
uses: actions/checkout@v4
with:
repository: WentsingNee/Kerbal
path: Kerbal

- name: Create Working Directory
run: >
mkdir -p ${{github.workspace}}/KerbalDoxygenDoc/
- name: Run Doxygen
uses: mattnotmitt/doxygen-action@v1.9.5
with:
working-directory: Kerbal/doxygen/
doxyfile-path: Doxyfile

- name: Commit Doxygen Outcomes
run: >
cd ${{github.workspace}}/KerbalDoxygenDoc/
ln -s ./html ./docs
git config --global init.defaultBranch main
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git init
git add docs html
git commit -m "Kerbal Doc Generated by Doxygen"
- name: Push Doxygen Outcomes
uses: ad-m/github-push-action@v0.8.0
with:
directory: ${{github.workspace}}/KerbalDoxygenDoc/
repository: WentsingNee/KerbalDoxygenDoc
branch: main
force: true
github_token: ${{secrets.KERBAL_UPLOAD_DOXYGEN_DOC_TOKEN}}

0 comments on commit beb9d42

Please sign in to comment.