mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
62c152d9a7
Fixes: bfbbc882 ("Change user.name/user.email to robot for deploy via github actions")
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
---
|
|
name: doxygen
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
Doxygen:
|
|
runs-on: ubuntu-18.04
|
|
if: "!contains(github.event.head_commit.message, 'ci skip')"
|
|
strategy:
|
|
fail-fast: false
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2.0.0
|
|
- name: Install Depends
|
|
run: |
|
|
sudo apt install doxygen libmbedtls-dev
|
|
|
|
- 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
|
|
|
|
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 "Libevent Github Robot"
|
|
git config --local user.email "robot@libevent.org"
|
|
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
|