Add .gitea/workflows/build.yml
This commit is contained in:
38
.gitea/workflows/build.yml
Normal file
38
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
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: 18
|
||||
|
||||
- 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 || true
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user