ci: workflow to publish docs

This commit is contained in:
Михаил Чернигин 2023-09-22 15:45:47 +04:00
parent de35ac5d9a
commit a1cf28e856
Signed by: cherniginma
GPG Key ID: 42ED11B71604A422

39
.github/workflows/publish-api-docs.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: baselib-publish-api-doc
on: [ workflow_call, workflow_dispatch ]
jobs:
baselib-publish-api-doc:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Create clean documentation branch
run: git checkout -b documentation
- name: Install doxygen
run: sudo apt-get install doxygen
- name: Generate autodocs
run: doxygen
- name: Add generated autodocs to Git repo in the documentation branch
run: |
git config --global user.email "baselib-github-bot@basealt.ru"
git config --global user.name "$GITHUB_WORKFLOW GitHub action"
git add -f docs
git commit -am "docs: add auto-generated developer documentation"
- name: Publish autodocs as GitHub pages
run: git push -f origin documentation:documentation
- name: Result URLs
run: |
REPO_OWNER=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 1)
REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 2)
echo "Documentation on a github.io: https://$REPO_OWNER.github.io/$REPO_NAME/docs"
echo ""
echo "Documentation branch: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/tree/documentation"