mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Pnpm is like npm except instead of keeping multiple copies of dependencies, it shares a single copy for multiple dependencies significantly reducing build time and the space needed to hold all the dependencies. Read [here](https://pnpm.io/motivation) for more info. This changes our CI to use pnpm and allows developers to choose to use pnpm instead of npm. Also, pnpm has a built-in node version manager so devs no longer need to use nvm to work on photonvision. All npm functionality (including photon-server gradle tasks) still functions using npm so this isn't breaking. We should make a docs change to suggest to use pnpm.
103 lines
2.5 KiB
YAML
103 lines
2.5 KiB
YAML
name: Photon Code Documentation
|
|
|
|
on:
|
|
# Run on pushes to master and pushed tags, and on pull requests against master, but ignore the docs folder
|
|
push:
|
|
branches: [ master ]
|
|
tags:
|
|
- 'v*'
|
|
paths:
|
|
- '**'
|
|
- '!docs/**'
|
|
- '.github/**'
|
|
pull_request:
|
|
branches: [ master ]
|
|
paths:
|
|
- '**'
|
|
- '!docs/**'
|
|
- '.github/**'
|
|
|
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-client:
|
|
name: "PhotonClient Build"
|
|
defaults:
|
|
run:
|
|
working-directory: photon-client
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 18
|
|
cache: 'pnpm'
|
|
cache-dependency-path: '**/pnpm-lock.yaml'
|
|
- name: Install Dependencies
|
|
run: pnpm install
|
|
- name: Build Production Client
|
|
run: pnpm run build-demo
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: built-client
|
|
path: photon-client/dist/
|
|
|
|
run_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@v3
|
|
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: built-docs
|
|
path: photon-docs/build/docs
|
|
|
|
release:
|
|
needs: [build-client, run_docs]
|
|
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
|
|
# Download literally every single artifact.
|
|
- uses: actions/download-artifact@v4
|
|
|
|
- run: find .
|
|
- name: copy file via ssh password
|
|
if: github.ref == 'refs/heads/master'
|
|
uses: appleboy/scp-action@v0.1.7
|
|
with:
|
|
host: ${{ secrets.WEBMASTER_SSH_HOST }}
|
|
username: ${{ secrets.WEBMASTER_SSH_USERNAME }}
|
|
password: ${{ secrets.WEBMASTER_SSH_KEY }}
|
|
port: ${{ secrets.WEBMASTER_SSH_PORT }}
|
|
source: "*"
|
|
target: /var/www/html/photonvision-docs/
|