restructure

This commit is contained in:
2026-05-29 11:16:00 -04:00
parent abeb9d04d0
commit 1ffe0c23cb
27 changed files with 14 additions and 14 deletions
+26
View File
@@ -0,0 +1,26 @@
# Node Build
<!-- action-docs-description source="action.yml" -->
## Description
Install dependencies, build, and upload a build artifact
<!-- action-docs-description source="action.yml" -->
<!-- action-docs-inputs source="action.yml" -->
## Inputs
| name | description | required | default |
| --- | --- | --- | --- |
| `INSTALL_CMD` | <p>Install command</p> | `false` | `npm ci` |
| `BUILD_SCRIPT` | <p>npm script to run for the main build</p> | `false` | `build:stage` |
| `EXTRA_BUILD_SCRIPT` | <p>Optional additional npm script to run after the main build</p> | `false` | `""` |
| `ARTIFACT_NAME` | <p>Name to give the uploaded artifact</p> | `false` | `dist` |
| `ARTIFACT_PATH` | <p>Path to upload as the artifact</p> | `false` | `dist` |
| `COPY_PRISMA_ENGINE` | <p>Copy the Prisma query engine binaries into the build directory</p> | `false` | `false` |
<!-- action-docs-inputs source="action.yml" -->
<!-- action-docs-runs source="action.yml" -->
## Runs
This action is a `composite` action.
<!-- action-docs-runs source="action.yml" -->
+56
View File
@@ -0,0 +1,56 @@
name: Node Build
description: Install dependencies, build, and upload a build artifact
inputs:
INSTALL_CMD:
description: "Install command"
default: "npm ci"
BUILD_SCRIPT:
description: "npm script to run for the main build"
default: "build:stage"
EXTRA_BUILD_SCRIPT:
description: "Optional additional npm script to run after the main build"
default: ""
ARTIFACT_NAME:
description: "Name to give the uploaded artifact"
default: "dist"
ARTIFACT_PATH:
description: "Path to upload as the artifact"
default: "dist"
COPY_PRISMA_ENGINE:
description: "Copy the Prisma query engine binaries into the build directory"
default: "false"
runs:
using: composite
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v5
with:
node-version-file: package.json
- name: Install
shell: sh
run: ${{ inputs.INSTALL_CMD }}
- name: Build
shell: sh
run: |
npm run ${{ inputs.BUILD_SCRIPT }}
if [ -n "${{ inputs.EXTRA_BUILD_SCRIPT }}" ]; then
npm run ${{ inputs.EXTRA_BUILD_SCRIPT }}
fi
- name: Copy Prisma Client Engine
if: inputs.COPY_PRISMA_ENGINE == 'true'
shell: sh
run: |
mkdir -p build/prisma
cp node_modules/.prisma/client/libquery_engine-* build/prisma/
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.ARTIFACT_NAME }}
path: ${{ inputs.ARTIFACT_PATH }}