Skip to content

Updates 20240121

Updates 20240121 #355

Workflow file for this run

name: docs
on:
push:
branches: [ "master", "release-1.1" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master", "release-1.1" ]
env:
TARGET_BRANCH_NAME: ${{github.base_ref || github.ref_name}}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout ${{env.TARGET_BRANCH_NAME}}
uses: actions/checkout@v4
with:
path: repo/${{env.TARGET_BRANCH_NAME}}
- name: Prerequisites
run: |
sudo apt-get -y update
apt-cache showpkg doxygen
sudo apt-get -y install doxygen graphviz
- name: Configure
run: >
cmake -S ${{github.workspace}}/repo/${{env.TARGET_BRANCH_NAME}} -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=Release
-DPLAYRHO_BUILD_DOC=ON
-DPLAYRHO_BUILD_LIBRARY=OFF
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release
- name: Install
run: cmake --install ${{github.workspace}}/build --prefix ${{github.workspace}}/install
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: docs-${{env.TARGET_BRANCH_NAME}}
path: ${{github.workspace}}/install/share/doc/PlayRho
- name: Checkout gh-pages
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v4
with:
ref: 'gh-pages'
path: repo/gh-pages
- name: Update gh-pages
if: ${{ github.event_name == 'push' }}
working-directory: ${{github.workspace}}/repo/gh-pages/API
run: |
mv ${{env.TARGET_BRANCH_NAME}} ${{env.TARGET_BRANCH_NAME}}.old
mkdir -p ${{env.TARGET_BRANCH_NAME}}
rsync -a ${{github.workspace}}/build/Documentation/API/html/ ${{env.TARGET_BRANCH_NAME}}
- name: Git Config Add Commit
if: ${{ github.event_name == 'push' }}
working-directory: ${{github.workspace}}/repo/gh-pages
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add API/${{env.TARGET_BRANCH_NAME}}
git commit -m "Updates for ${{env.TARGET_BRANCH_NAME}}"
- name: Git Push
if: ${{ github.event_name == 'push' }}
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
directory: ${{github.workspace}}/repo/gh-pages