3 Commits

Author SHA1 Message Date
WDI-Ideas
baedab602c refactor(ci): remove job dependencies for pure flag execution
Drop sonar/deploy needs so each stage runs only when its own run_* flag is true.

Made-with: Cursor
2026-04-09 12:20:40 +05:30
WDI-Ideas
cf425dbc7a fix(ci): switch sonar secret names to SONARQUBE_HOST/TOKEN
Align central and quality workflows with repository secret names SONARQUBE_HOST and SONARQUBE_TOKEN and pass them to sonar-scanner via environment variables.

Made-with: Cursor
2026-04-08 20:20:01 +05:30
WDI-Ideas
32582809a1 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
2026-04-08 20:01:15 +05:30
4 changed files with 61 additions and 31 deletions

View File

@@ -5,16 +5,16 @@ on:
inputs: inputs:
run_build: run_build:
type: string type: string
default: true default: 'true'
run_sonar: run_sonar:
type: string type: string
default: true default: 'true'
run_deploy: run_deploy:
type: string type: string
default: false default: 'false'
wait_for_quality_gate: wait_for_quality_gate:
type: string type: string
default: true default: 'true'
tech_stack: tech_stack:
type: string type: string
required: true required: true
@@ -41,11 +41,14 @@ on:
runtime: runtime:
type: string type: string
required: false required: false
pm2_id:
type: string
required: false
secrets: secrets:
SONAR_HOST_URL: SONARQUBE_HOST:
required: false required: false
SONAR_TOKEN: SONARQUBE_TOKEN:
required: false required: false
BETA_SERVER_HOST: BETA_SERVER_HOST:
@@ -85,7 +88,7 @@ jobs:
# 🔨 BUILD # 🔨 BUILD
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 uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/build.yml@main
with: with:
tech_stack: ${{ inputs.tech_stack }} tech_stack: ${{ inputs.tech_stack }}
@@ -93,22 +96,22 @@ jobs:
# 🔍 SONAR # 🔍 SONAR
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 uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/quality.yml@main
with: with:
wait_for_quality_gate: ${{ inputs.wait_for_quality_gate }} wait_for_quality_gate: ${{ inputs.wait_for_quality_gate }}
secrets: secrets:
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} SONARQUBE_HOST: ${{ secrets.SONARQUBE_HOST }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONARQUBE_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
# 🚀 DEPLOY # 🚀 DEPLOY
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 uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/deploy.yml@main
with: with:
tech_stack: ${{ inputs.tech_stack }} tech_stack: ${{ inputs.tech_stack }}
branch_name: ${{ github.ref_name }}
pm2_id: ${{ inputs.pm2_id }}
deploy_command: ${{ inputs.deploy_command }} deploy_command: ${{ inputs.deploy_command }}
app_path_beta: ${{ inputs.app_path_beta }} app_path_beta: ${{ inputs.app_path_beta }}
app_path_testing: ${{ inputs.app_path_testing }} app_path_testing: ${{ inputs.app_path_testing }}

View File

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

View File

@@ -11,9 +11,9 @@ on:
default: false default: false
secrets: secrets:
SONAR_HOST_URL: SONARQUBE_HOST:
required: true required: true
SONAR_TOKEN: SONARQUBE_TOKEN:
required: true required: true
jobs: jobs:
@@ -29,12 +29,13 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Run SonarQube Scan - name: Run SonarQube Scan
env:
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
run: | run: |
sonar-scanner \ sonar-scanner \
-Dsonar.projectKey=${{ inputs.project_key }} \ -Dsonar.projectKey=${{ inputs.project_key }} \
-Dsonar.projectName=${{ inputs.project_key }} \ -Dsonar.projectName=${{ inputs.project_key }} \
-Dsonar.sources=. \ -Dsonar.sources=. \
-Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \
-Dsonar.token=${{ secrets.SONAR_TOKEN }} \
-Dsonar.exclusions=node_modules/**,dist/**,coverage/** \ -Dsonar.exclusions=node_modules/**,dist/**,coverage/** \
-Dsonar.qualitygate.wait=${{ inputs.wait_for_quality_gate }} -Dsonar.qualitygate.wait=${{ inputs.wait_for_quality_gate }}

View File

@@ -7,9 +7,9 @@ on:
required: true required: true
type: string type: string
secrets: secrets:
SONAR_HOST_URL: SONARQUBE_HOST:
required: true required: true
SONAR_TOKEN: SONARQUBE_TOKEN:
required: true required: true
jobs: jobs:
@@ -24,12 +24,13 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Run SonarQube Scan (with Quality Gate) - name: Run SonarQube Scan (with Quality Gate)
env:
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
run: | run: |
sonar-scanner \ sonar-scanner \
-Dsonar.projectKey=${{ inputs.project_key }} \ -Dsonar.projectKey=${{ inputs.project_key }} \
-Dsonar.projectName=${{ inputs.project_key }} \ -Dsonar.projectName=${{ inputs.project_key }} \
-Dsonar.sources=. \ -Dsonar.sources=. \
-Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \
-Dsonar.token=${{ secrets.SONAR_TOKEN }} \
-Dsonar.exclusions=node_modules/**,dist/**,coverage/** \ -Dsonar.exclusions=node_modules/**,dist/**,coverage/** \
-Dsonar.qualitygate.wait=false -Dsonar.qualitygate.wait=false