Skip to content

Latest commit

 

History

History
75 lines (56 loc) · 1.52 KB

File metadata and controls

75 lines (56 loc) · 1.52 KB

Frontend Build Action

GitHub Action to build frontend assets with npm, yarn, or pnpm.

Features

  • ✅ Auto-detects package manager (npm, yarn, pnpm)
  • ✅ Automatic dependency caching
  • Build output caching - Caches public/build/ for 60% faster rebuilds
  • ✅ Configurable Node.js version
  • ✅ Custom build script support

Usage

- uses: zeroseven/action-frontend-build@v1
  with:
    node-version: '20'

Inputs

Input Description Required Default
node-version Node.js version to use No 20
working-directory Working directory No .
build-script Build script name No build
install-command Custom install command No Auto-detect
cache Enable package manager caching No true

Examples

Basic Usage (Auto-detect)

The action automatically detects your package manager based on lock files:

steps:
  - uses: actions/checkout@v4
  - uses: zeroseven/action-frontend-build@v1

Custom Node Version

steps:
  - uses: actions/checkout@v4
  - uses: zeroseven/action-frontend-build@v1
    with:
      node-version: '18'

Custom Build Script

steps:
  - uses: actions/checkout@v4
  - uses: zeroseven/action-frontend-build@v1
    with:
      build-script: 'prod'

Custom Install Command

steps:
  - uses: actions/checkout@v4
  - uses: zeroseven/action-frontend-build@v1
    with:
      install-command: 'npm ci --legacy-peer-deps'

License

MIT