Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: ["main"]
env:
VITE_GITHUB_AUTH_TOKEN: ${{ secrets.VITE_GITHUB_AUTH_TOKEN }}
VITE_GITHUB_ORG: SlimeVR
pull_request:
branches: "main"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v4
Expand All @@ -24,8 +26,13 @@ jobs:
cache: "pnpm"
- run: pnpm i
- run: NITRO_PRESET=cloudflare_pages_static pnpm build
env:
VITE_GITHUB_AUTH_TOKEN: ${{ secrets.VITE_GITHUB_AUTH_TOKEN }}
VITE_GITHUB_ORG: SlimeVR
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy dist/ --project-name "slimevr-main-website" --branch "main"
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist/ --project-name "slimevr-main-website" --branch '${{ github.ref == 'refs/heads/main' && 'main' || github.event.pull_request.number }}'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}