From 1af3dab37a0372284cd30e895d97986dba3f63db Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Thu, 10 Apr 2025 23:38:23 -0500 Subject: [PATCH] Fix CI for website (#1877) ## Description We forgot to go to the correct directory prior to running ``npm ci``, so now I'm adding it. PROOF: see the passing website test ## 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_ - [x] If this PR changes behavior or adds a feature, user documentation is updated - [x] If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly - [x] If this PR touches configuration, this is backwards compatible with settings back to v2024.3.1 - [x] If this PR addresses a bug, a regression test for it is added --------- Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com> --- .github/workflows/website.yml | 23 +++++++++++++++++++++-- .gitignore | 3 +++ website/.prettierignore | 1 + website/package-lock.json | 4 ++-- website/src/main.ts | 2 +- 5 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 website/.prettierignore mode change 100755 => 100644 website/src/main.ts diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index b30e9eb5f..53891eb3f 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -4,9 +4,11 @@ on: push: # For now, run on all commits to main branches: [ main ] - # and also all tags starting with v tags: - 'v*' + pull_request: + branches: [ main ] + merge_group: jobs: rsync: @@ -17,12 +19,29 @@ jobs: uses: actions/setup-node@v4 - name: Install packages run: npm ci + working-directory: website - name: Build project run: npm run build + working-directory: website - uses: up9cloud/action-rsync@v1.4 + if: github.ref == 'refs/heads/main' env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} USER: ${{ secrets.WEBMASTER_SSH_USERNAME }} KEY: ${{secrets.WEBMASTER_SSH_KEY}} - SOURCE: /website/dist/* + SOURCE: website/dist/* TARGET: /var/www/html/photonvision-website + + format-check: + name: Check formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + - name: Install packages + run: npm ci + working-directory: website + - name: Build project + run: npx prettier -c . + working-directory: website diff --git a/.gitignore b/.gitignore index 27e2c667d..eaa45f922 100644 --- a/.gitignore +++ b/.gitignore @@ -151,3 +151,6 @@ venv .venv/* .venv networktables.json + +website/node_modules +website/dist diff --git a/website/.prettierignore b/website/.prettierignore new file mode 100644 index 000000000..433b4825f --- /dev/null +++ b/website/.prettierignore @@ -0,0 +1 @@ +*.min.css diff --git a/website/package-lock.json b/website/package-lock.json index c5cc31a09..1c0c377f4 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -1,11 +1,11 @@ { - "name": "vite-project", + "name": "photonvision-website", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "vite-project", + "name": "photonvision-website", "version": "0.0.0", "dependencies": { "@tailwindcss/vite": "^4.1.3", diff --git a/website/src/main.ts b/website/src/main.ts old mode 100755 new mode 100644 index 8b1378917..a1ea13e27 --- a/website/src/main.ts +++ b/website/src/main.ts @@ -1 +1 @@ - +// We don't use javascript, so this is empty