GitHub Action to set up Vite+ (@voidzero-dev/global) with dependency caching support.
- Install Vite+ globally with version specification
- Support both npm Registry and GitHub Package Registry
- Cache project dependencies with auto-detection of lock files
- Optionally run
vite installafter setup - Support for all major package managers (npm, pnpm, yarn)
- Node.js >= 22.12.0 (use actions/setup-node first)
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22'
- uses: voidzero-dev/setup-vite-plus-action@v1steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22'
- uses: voidzero-dev/setup-vite-plus-action@v1
with:
cache: true
run-install: truesteps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22'
- uses: voidzero-dev/setup-vite-plus-action@v1
with:
version: '1.2.3'
cache: truesteps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22'
- uses: voidzero-dev/setup-vite-plus-action@v1
with:
registry: github
github-token: ${{ secrets.GH_PKG_TOKEN }}steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22'
- uses: voidzero-dev/setup-vite-plus-action@v1
with:
cache: true
run-install: |
- cwd: ./packages/app
args: ['--frozen-lockfile']
- cwd: ./packages/lib| Input | Description | Required | Default |
|---|---|---|---|
version |
Version of @voidzero-dev/global to install | No | latest |
registry |
Registry to install from: npm or github |
No | npm |
github-token |
GitHub PAT for GitHub Package Registry | No | - |
run-install |
Run vite install after setup. Accepts boolean or YAML object with cwd/args |
No | true |
cache |
Enable caching of project dependencies | No | false |
cache-dependency-path |
Path to lock file for cache key generation | No | Auto-detected |
| Output | Description |
|---|---|
version |
The installed version of @voidzero-dev/global |
cache-hit |
Boolean indicating if cache was restored |
When cache: true is set, the action automatically detects your lock file and caches the appropriate package manager store:
| Lock File | Package Manager | Cache Directory |
|---|---|---|
pnpm-lock.yaml |
pnpm | pnpm store |
package-lock.json |
npm | npm cache |
yarn.lock |
yarn | yarn cache |
The cache key format is: vite-plus-{OS}-{arch}-{pm}-{lockfile-hash}
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22'
- uses: voidzero-dev/setup-vite-plus-action@v1
with:
cache: true
- run: vite run build
- run: vite run testMIT