|
| 1 | +name: docs |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + release: |
| 6 | + types: released |
| 7 | + |
| 8 | +jobs: |
| 9 | + docs: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v2 |
| 13 | + - name: Fetch Repository Reference Info |
| 14 | + id: repo-info |
| 15 | + run: | |
| 16 | + git fetch --prune --unshallow --tags |
| 17 | + RELEASE_TAG=${{ github.event.release.tag_name }} |
| 18 | + LATEST_TAG=$(git tag | grep -E '^v[0-9]' | sort -V | tail -1) |
| 19 | + GIT_SHA_SHORT=$(sed 's/\(.\{7\}\).*/\1/' <<< "$GITHUB_SHA") |
| 20 | + PROJECT_NUMBER=${RELEASE_TAG:-${LATEST_TAG:-$GIT_SHA_SHORT}} |
| 21 | + COMMIT_MSG=$PROJECT_NUMBER |
| 22 | + if [ "$PROJECT_NUMBER" != "$GIT_SHA_SHORT" ]; then COMMIT_MSG+=" ($GITHUB_SHA)"; fi |
| 23 | + echo "The project number is \"$PROJECT_NUMBER\" and the commit message is \"$COMMIT_MSG\"" |
| 24 | + echo "::set-output name=project-number::$PROJECT_NUMBER" |
| 25 | + echo "::set-output name=commit-message::$COMMIT_MSG" |
| 26 | +
|
| 27 | + - name: Install Doxygen |
| 28 | + env: |
| 29 | + DOXYGEN_VERSION: 1.9.3 |
| 30 | + run: | |
| 31 | + wget -q https://www.doxygen.nl/files/doxygen-${{ env.DOXYGEN_VERSION }}.linux.bin.tar.gz |
| 32 | + tar -xf doxygen-${{ env.DOXYGEN_VERSION }}.linux.bin.tar.gz |
| 33 | + cd doxygen-${{ env.DOXYGEN_VERSION }} && sudo make install |
| 34 | + sudo apt-get install libclang1-9 libclang-cpp9 |
| 35 | +
|
| 36 | + - name: Install Themes |
| 37 | + env: |
| 38 | + DOXYGEN_AWESOME_VERSION: 2.0.3 |
| 39 | + working-directory: ./docs |
| 40 | + run: | |
| 41 | + git clone --depth 1 -b v${{ env.DOXYGEN_AWESOME_VERSION }} https://github.com/jothepro/doxygen-awesome-css |
| 42 | +
|
| 43 | + - name: Generate Docs |
| 44 | + working-directory: ./docs |
| 45 | + run: | |
| 46 | + sed -i -E 's/(PROJECT_NUMBER\s*=\s*).*/\1 ${{ steps.repo-info.outputs.project-number }}/g' Doxyfile |
| 47 | + doxygen Doxyfile |
| 48 | +
|
| 49 | + - name: Deploy Docs |
| 50 | + uses: peaceiris/actions-gh-pages@v3 |
| 51 | + with: |
| 52 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + publish_branch: gh-pages |
| 54 | + publish_dir: ./docs/generated/html |
| 55 | + destination_dir: docs |
| 56 | + user_name: github-actions[bot] |
| 57 | + user_email: github-actions[bot]@users.noreply.github.com |
| 58 | + full_commit_message: Update docs for ${{ steps.repo-info.outputs.commit-message }} |
0 commit comments