mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Some dummy updated the [Caddyfile](https://github.com/PhotonVision/ansible-playbooks/blob/main/files/caddy/Caddyfile) on the server but never updated the playbook repo or the CI on main to reflect that. 🤷 Anyways, we're keeping the new Caddyfile because it makes pydocs work, and it more accurately reflects our CI process.
113 lines
3.1 KiB
YAML
113 lines
3.1 KiB
YAML
name: Photon API Documentation
|
|
|
|
on:
|
|
# Run on pushes to main and pushed tags, and on pull requests against main, but ignore the docs folder
|
|
push:
|
|
branches: [ main ]
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
branches: [ main ]
|
|
merge_group:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
build_demo:
|
|
name: Build PhotonClient Demo
|
|
defaults:
|
|
run:
|
|
working-directory: photon-client
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
- name: Install Dependencies
|
|
run: npm ci
|
|
- name: Build Production Client
|
|
run: npm run build-demo
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: built-demo
|
|
path: photon-client/dist/
|
|
|
|
run_java_cpp_docs:
|
|
name: Build Java and C++ API Docs
|
|
runs-on: "ubuntu-22.04"
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Fetch tags
|
|
run: git fetch --tags --force
|
|
- name: Install Java 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: 17
|
|
distribution: temurin
|
|
- name: Build javadocs/doxygen
|
|
run: |
|
|
chmod +x gradlew
|
|
./gradlew photon-docs:generateJavaDocs photon-docs:doxygen
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: docs-java-cpp
|
|
path: photon-docs/build/docs
|
|
|
|
publish_api_docs:
|
|
name: Publish API Docs
|
|
needs: [run_java_cpp_docs]
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
# Download docs artifact
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
pattern: docs-*
|
|
- run: find .
|
|
- name: Publish Docs To Development
|
|
if: github.ref == 'refs/heads/main'
|
|
uses: up9cloud/action-rsync@v1.4
|
|
env:
|
|
HOST: ${{ secrets.WEBMASTER_SSH_HOST }}
|
|
USER: ${{ secrets.WEBMASTER_SSH_USERNAME }}
|
|
KEY: ${{secrets.WEBMASTER_SSH_KEY}}
|
|
TARGET: /var/www/html/photonvision-docs/development/
|
|
- name: Publish Docs To Release
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: up9cloud/action-rsync@v1.4
|
|
env:
|
|
HOST: ${{ secrets.WEBMASTER_SSH_HOST }}
|
|
USER: ${{ secrets.WEBMASTER_SSH_USERNAME }}
|
|
KEY: ${{ secrets.WEBMASTER_SSH_KEY }}
|
|
TARGET: /var/www/html/photonvision-docs/release/
|
|
|
|
publish_demo:
|
|
name: Publish PhotonClient Demo
|
|
needs: [build_demo]
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: built-demo
|
|
- run: find .
|
|
- name: Publish demo
|
|
if: github.ref == 'refs/heads/main'
|
|
uses: up9cloud/action-rsync@v1.4
|
|
env:
|
|
HOST: ${{ secrets.WEBMASTER_SSH_HOST }}
|
|
USER: ${{ secrets.WEBMASTER_SSH_USERNAME }}
|
|
KEY: ${{ secrets.WEBMASTER_SSH_KEY }}
|
|
TARGET: /var/www/html/photonvision-demo
|