speeduino/.github/workflows/doxygen.yml

50 lines
1.6 KiB
YAML

# This is a basic workflow to help you get started with Actions
name: Doxygen Action
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Doxygen Action
uses: mattnotmitt/doxygen-action@v1.1.0
with:
# Path to Doxyfile
doxyfile-path: "./Doxyfile" # default is ./Doxyfile
# Working directory
working-directory: "." # default is .
- name: Setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Commit Doxygen HTML
if: github.event_name != 'pull_request'
env:
GH_DOXYGEN: ${{ secrets.GH_DOXYGEN }}
run: |
cd ..
git clone https://github.com/speeduino/speeduino-doxygen
cp -r speeduino/reference/doxygen/html/* speeduino-doxygen
cd speeduino-doxygen
git add --all
git commit --allow-empty -m "Deploy code docs to GitHub repo. Commit ${GITHUB_SHA}"
git push --force "https://${GH_DOXYGEN}@github.com/speeduino/speeduino-doxygen" > /dev/null 2>&1