mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
## Description CI will now run whenever a branch is pushed or a PR is opened. Fixes 2027 behaviour and allows running CI on forks ## Meta Merge checklist: - [x] Pull Request title is [short, imperative summary](https://cbea.ms/git-commit/) of proposed changes - [x] The description documents the _what_ and _why_ - [ ] If this PR changes behavior or adds a feature, user documentation is updated - [ ] If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly - [ ] If this PR touches configuration, this is backwards compatible with settings back to v2024.3.1 - [ ] If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated - [ ] If this PR addresses a bug, a regression test for it is added Signed-off-by: Jade Turner <spacey-sooty@proton.me>
108 lines
3.0 KiB
YAML
108 lines
3.0 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:
|
|
pull_request:
|
|
|
|
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
|