Skip to content

Update generate_documentation.yml #99

Update generate_documentation.yml

Update generate_documentation.yml #99

name: Generate Documentation
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18] # Easily add more versions if needed
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then
python -m pip install -r requirements.txt
else
echo "No requirements.txt found, skipping Python dependency install."
fi
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Generate API documentation
run: |
if [ -d vendor ]; then
cd vendor
python APIGenerator/src/gen.py --build
else
echo "⚠️ Vendor folder not found. Skipping API generation."
fi
- name: Install and Build with npm
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi
npm run build --if-present
- name: Deploy 🚀
if: success() # only deploy if build succeeds
uses: JamesIves/github-pages-deploy-action@v4.2.3
with:
branch: gh-pages
folder: build