38 lines
931 B
YAML
38 lines
931 B
YAML
name: Build
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
tech_stack:
|
|
type: string
|
|
required: true
|
|
build_command:
|
|
type: string
|
|
required: false
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
|
|
# 🟢 NODE / REACT / NESTJS
|
|
- name: Setup Node
|
|
if: inputs.tech_stack == 'node' || inputs.tech_stack == 'react' || inputs.tech_stack == 'nestjs'
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Build (Node / React / NestJS)
|
|
if: inputs.tech_stack == 'node' || inputs.tech_stack == 'react' || inputs.tech_stack == 'nestjs'
|
|
run: |
|
|
if [ -n "${{ inputs.build_command }}" ]; then
|
|
echo "Running custom build command"
|
|
${{ inputs.build_command }}
|
|
else
|
|
npm install
|
|
npm run build
|
|
fi
|
|
|