mirror of
https://github.com/mchernigin/libqbase.git
synced 2025-03-12 04:58:36 +03:00
ci: workflow to publish docs
This commit is contained in:
parent
de35ac5d9a
commit
a1cf28e856
39
.github/workflows/publish-api-docs.yml
vendored
Normal file
39
.github/workflows/publish-api-docs.yml
vendored
Normal 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"
|
Loading…
x
Reference in New Issue
Block a user