fix(ci): align workflow_call inputs across central and deploy workflows

Pass missing branch_name/pm2_id to deploy workflow, add matching deploy inputs, and harden run_* conditions to support both boolean and string true/false values.

Made-with: Cursor
This commit is contained in:
WDI-Ideas
2026-04-08 20:01:15 +05:30
parent 645a44d0f8
commit 32582809a1
2 changed files with 47 additions and 17 deletions

View File

@@ -5,16 +5,16 @@ on:
inputs:
run_build:
type: string
default: true
default: 'true'
run_sonar:
type: string
default: true
default: 'true'
run_deploy:
type: string
default: false
default: 'false'
wait_for_quality_gate:
type: string
default: true
default: 'true'
tech_stack:
type: string
required: true
@@ -41,6 +41,9 @@ on:
runtime:
type: string
required: false
pm2_id:
type: string
required: false
secrets:
SONAR_HOST_URL:
@@ -85,7 +88,7 @@ jobs:
# 🔨 BUILD
build:
if: inputs.run_build == 'true'
if: inputs.run_build == true || inputs.run_build == 'true'
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/build.yml@main
with:
tech_stack: ${{ inputs.tech_stack }}
@@ -93,7 +96,7 @@ jobs:
# 🔍 SONAR
sonar:
if: inputs.run_sonar == 'true'
if: inputs.run_sonar == true || inputs.run_sonar == 'true'
needs: build
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/quality.yml@main
with:
@@ -104,11 +107,13 @@ jobs:
# 🚀 DEPLOY
deploy:
if: inputs.run_deploy == 'true'
if: inputs.run_deploy == true || inputs.run_deploy == 'true'
needs: [build, sonar]
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/deploy.yml@main
with:
tech_stack: ${{ inputs.tech_stack }}
branch_name: ${{ github.ref_name }}
pm2_id: ${{ inputs.pm2_id }}
deploy_command: ${{ inputs.deploy_command }}
app_path_beta: ${{ inputs.app_path_beta }}
app_path_testing: ${{ inputs.app_path_testing }}

View File

@@ -13,12 +13,18 @@ on:
app_path_beta:
required: false
type: string
app_path_testing:
required: false
type: string
app_path_staging:
required: false
type: string
app_path_prod:
required: false
type: string
deploy_command:
required: false
type: string
pm2_id:
required: false
@@ -77,7 +83,11 @@ jobs:
script: |
set -xe
cd ${{ inputs.app_path_beta }}
if [ "${{ inputs.branch_name }}" = "testing" ] && [ -n "${{ inputs.app_path_testing }}" ]; then
cd ${{ inputs.app_path_testing }}
else
cd ${{ inputs.app_path_beta }}
fi
git fetch
git reset --hard origin/${{ inputs.branch_name }}
@@ -85,9 +95,14 @@ jobs:
case "${{ inputs.tech_stack }}" in
node|react|nestjs)
npm install
npm run build || true
pm2 reload ${{ inputs.pm2_id }} || true
if [ -n "${{ inputs.deploy_command }}" ]; then
echo "Running custom deploy command"
${{ inputs.deploy_command }}
else
npm install
npm run build || true
pm2 reload ${{ inputs.pm2_id }} || true
fi
;;
docker)
docker compose up -d --build
@@ -119,9 +134,14 @@ jobs:
case "${{ inputs.tech_stack }}" in
node|react|nestjs)
npm install
npm run build || true
pm2 reload ${{ inputs.pm2_id }} || true
if [ -n "${{ inputs.deploy_command }}" ]; then
echo "Running custom deploy command"
${{ inputs.deploy_command }}
else
npm install
npm run build || true
pm2 reload ${{ inputs.pm2_id }} || true
fi
;;
docker)
docker compose up -d --build
@@ -153,9 +173,14 @@ jobs:
case "${{ inputs.tech_stack }}" in
node|react|nestjs)
npm install
npm run build || true
pm2 reload ${{ inputs.pm2_id }} || true
if [ -n "${{ inputs.deploy_command }}" ]; then
echo "Running custom deploy command"
${{ inputs.deploy_command }}
else
npm install
npm run build || true
pm2 reload ${{ inputs.pm2_id }} || true
fi
;;
docker)
docker compose up -d --build