]> granicus.if.org Git - libevent/commitdiff
github actions: doxygen
authoryuangongji <yuangongji@foxmail.com>
Tue, 21 Jan 2020 02:14:11 +0000 (10:14 +0800)
committerAzat Khuzhin <azat@libevent.org>
Sun, 26 Jan 2020 22:50:13 +0000 (01:50 +0300)
.github/workflows/doxygen.yml [new file with mode: 0644]

diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml
new file mode 100644 (file)
index 0000000..a03c241
--- /dev/null
@@ -0,0 +1,58 @@
+---
+name: doxygen
+
+on:
+  push:
+    branches:
+      - master
+
+jobs:
+  Doxygen:
+    runs-on: ubuntu-18.04
+    strategy:
+      fail-fast: false
+
+    steps:
+      - uses: actions/checkout@v2.0.0
+      - name: Install Depends
+        run: |
+          sudo apt install doxygen
+
+      - name: Generate Doxygen
+        shell: bash
+        run: |
+          mkdir build
+          cd build
+          cmake -DEVENT__DOXYGEN=ON ..
+          make doxygen
+
+      - name: Deploy Documentation
+        env:
+          LIBEVENT_DEPLOY_PRI: ${{ secrets.LIBEVENT_DEPLOY_PRI }}
+          COMMIT_ID: ${{ github.sha }}
+        run: |
+          [[ -n $LIBEVENT_DEPLOY_PRI ]] || exit 0
+
+          mkdir -p ~/.ssh
+          echo "$LIBEVENT_DEPLOY_PRI" > ~/.ssh/id_rsa
+          chmod 600 ~/.ssh/id_rsa
+          ssh-keyscan github.com >> ~/.ssh/known_hosts
+
+          user_name="${{ github.event.head_commit.author.name }}"
+          user_email="${{ github.event.head_commit.author.email }}"
+          short_commit_id="${COMMIT_ID:0:7}"
+          owner_name="${{ github.event.repository.owner.name }}"
+
+          cd ./build/doxygen/html
+          git init
+          git config --local user.name $user_name
+          git config --local user.email $user_email
+          git add -f .
+          git commit -m "Update documentation (libevent/libevent@$short_commit_id)"
+          git push -f git@github.com:$owner_name/doc master
+
+      - uses: actions/upload-artifact@v1
+        if: failure()
+        with:
+          name: doxygen-build
+          path: build