fix(ci): align workflow_call flags, Sonar project_key, and deploy wiring

Made-with: Cursor
This commit is contained in:
WDI-Ideas
2026-04-07 22:45:18 +05:30
parent 1990bd2923
commit 1f8640a264
3 changed files with 20 additions and 13 deletions

View File

@@ -5,15 +5,16 @@ on:
inputs:
run_build:
type: string
required: true
required: true
run_sonar:
type: string
required: true
required: true
run_deploy:
type: string
required: true
required: true
wait_for_quality_gate:
type: string
required: false
tech_stack:
type: string
required: true
@@ -40,6 +41,9 @@ on:
runtime:
type: string
required: false
pm2_id:
type: string
required: false
secrets:
SONAR_HOST_URL:
@@ -84,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 }}
@@ -92,25 +96,26 @@ 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:
project_key: ${{ github.event.repository.name }}
wait_for_quality_gate: ${{ inputs.wait_for_quality_gate }}
secrets:
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# 🚀 DEPLOY
# 🚀 DEPLOY (runs after build; sonar may be skipped)
deploy:
if: inputs.run_deploy == 'true'
if: ${{ always() && (inputs.run_deploy == true || inputs.run_deploy == 'true') && needs.build.result == 'success' && (needs.sonar.result == 'success' || needs.sonar.result == 'skipped') }}
needs: [build, sonar]
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/deploy.yml@main
with:
tech_stack: ${{ inputs.tech_stack }}
deploy_command: ${{ inputs.deploy_command }}
branch_name: ${{ github.ref_name }}
pm2_id: ${{ inputs.pm2_id }}
app_path_beta: ${{ inputs.app_path_beta }}
app_path_testing: ${{ inputs.app_path_testing }}
app_path_staging: ${{ inputs.app_path_staging }}
app_path_prod: ${{ inputs.app_path_prod }}
secrets:
@@ -130,4 +135,4 @@ jobs:
PROD_SERVER_PORT: ${{ secrets.PROD_SERVER_PORT }}
PROD_SERVER_USERNAME: ${{ secrets.PROD_SERVER_USERNAME }}
PROD_SERVER_PASSWORD: ${{ secrets.PROD_SERVER_PASSWORD }}
PROD_SERVER_KEY: ${{ secrets.PROD_SERVER_KEY }}
PROD_SERVER_KEY: ${{ secrets.PROD_SERVER_KEY }}

View File

@@ -8,7 +8,8 @@ on:
required: true
wait_for_quality_gate:
type: string
default: false
required: false
default: 'false'
secrets:
SONAR_HOST_URL:
@@ -37,4 +38,4 @@ jobs:
-Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \
-Dsonar.token=${{ secrets.SONAR_TOKEN }} \
-Dsonar.exclusions=node_modules/**,dist/**,coverage/** \
-Dsonar.qualitygate.wait=${{ inputs.wait_for_quality_gate }}
-Dsonar.qualitygate.wait=${{ inputs.wait_for_quality_gate == true || inputs.wait_for_quality_gate == 'true' }}

View File

@@ -30,10 +30,11 @@ jobs:
with:
tech_stack: node
# run_* flags: use YAML `true`/`false` or "true"/"false" — central workflow treats both.
run_build: true
run_sonar: true
run_deploy: true
wait_for_quality_gate: false
wait_for_quality_gate: 'false'
app_path_beta: /var/www/app-beta
app_path_staging: /var/www/app-staging