js8call/.github/workflows/build-docs.yml
2026-08-11 13:35:30 -04:00

83 lines
2.8 KiB
YAML

name: Build and Deploy Docs
# Trigger only if we have labeled the PR "documentation", or a manual trigger
on:
workflow_dispatch:
pull_request:
types: [labeled]
permissions:
contents: write
id-token: write
pages: write
jobs:
build_docs:
if: (contains(github.event.pull_request.labels.*.name, 'documentation') ||
(contains(github.event_name, 'workflow_dispatch')) )
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Update dependences
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz flex bison make cmake g++
- name: Cache Check doxygen 1.16.1
id: cache-doxy
uses: actions/cache/restore@v5
with:
path: /home/runner/work/JS8Call-improved/JS8Call-improved/local/doxygen1161
key: ${{ runner.os }}-${{ runner.arch }}-doxygen1161
## doxygen
- name: Install doxygen 1.16.1
if: steps.cache-doxy.outputs.cache-hit != 'true'
id: install-doxy
run: |
cd /tmp/
wget https://github.com/doxygen/doxygen/releases/download/Release_1_16_1/doxygen-1.16.1.src.tar.gz
tar zxf doxygen-1.16.1.src.tar.gz
cd doxygen-1.16.1
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/home/runner/work/JS8Call-improved/JS8Call-improved/local/doxygen1161 ..
make
sudo make install
- name: Save cache doxygen 1.16.1
if: steps.cache-doxy.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
with:
key: ${{ runner.os }}-${{ runner.arch }}-doxygen1161
path: /home/runner/work/JS8Call-improved/JS8Call-improved/local/doxygen1161
- name: Check install dir
run: ls -lR /home/runner/work/JS8Call-improved/JS8Call-improved/local/doxygen1161/
- name: Build docs
run: (cat .github/workflows/misc/Doxyfile; echo "PROJECT_NUMBER=master";) | /home/runner/work/JS8Call-improved/JS8Call-improved/local/doxygen1161/bin/doxygen -
- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v5
with:
path: docs/html
# Only run deploy if we are on master branch
# if: github.ref == 'refs/heads/master'
# Try deploying on/from release branch or master. check paths afterwards
deploy:
if: startsWith(github.ref, 'refs/heads/release/') || contains(github.ref, '/tags/release') || contains(github.ref, 'refs/heads/master')
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build_docs
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5