Files
wdipl-actions/.gitea/workflows/ci.yml
WDI-Ideas 6b9982def7 fix(ci): single ci_steps string for WDIPL-Runner workflow_call input bug
Runner only propagated the first flag input to nested jobs; use comma-separated
ci_steps (build,sonar,deploy) and contains() on padded tokens.

Made-with: Cursor
2026-04-07 23:55:48 +05:30

136 lines
4.1 KiB
YAML

name: Central CI
on:
workflow_call:
inputs:
# WDIPL-Runner v0.2.12: only the first truthy workflow_call flag reached nested jobs; the rest
# were empty. Use ONE comma-separated input so Act forwards a single string with all steps.
# Tokens: build, sonar, deploy (e.g. "build,sonar,deploy" or "build" only).
ci_steps:
type: string
required: true
wait_for_quality_gate:
type: string
required: false
tech_stack:
type: string
required: true
# Variables
app_path_beta:
type: string
required: false
app_path_testing:
type: string
required: false
app_path_staging:
type: string
required: false
app_path_prod:
type: string
required: false
build_command:
type: string
required: false
deploy_command:
type: string
required: false
runtime:
type: string
required: false
pm2_id:
type: string
required: false
secrets:
SONAR_HOST_URL:
required: false
SONAR_TOKEN:
required: false
BETA_SERVER_HOST:
required: false
BETA_SERVER_PORT:
required: false
BETA_SERVER_USERNAME:
required: false
BETA_SERVER_PASSWORD:
required: false
BETA_SERVER_KEY:
required: false
STAGING_SERVER_HOST:
required: false
STAGING_SERVER_PORT:
required: false
STAGING_SERVER_USERNAME:
required: false
STAGING_SERVER_PASSWORD:
required: false
STAGING_SERVER_KEY:
required: false
PROD_SERVER_HOST:
required: false
PROD_SERVER_PORT:
required: false
PROD_SERVER_USERNAME:
required: false
PROD_SERVER_PASSWORD:
required: false
PROD_SERVER_KEY:
required: false
jobs:
# 🔨 BUILD
build:
if: ${{ contains(format(',{0},', replace(inputs.ci_steps, ' ', '')), ',build,') }}
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/build.yml@main
with:
tech_stack: ${{ inputs.tech_stack }}
build_command: ${{ inputs.build_command }}
# 🔍 SONAR
sonar:
if: ${{ contains(format(',{0},', replace(inputs.ci_steps, ' ', '')), ',sonar,') }}
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 (runs after build; sonar may be skipped)
deploy:
if: ${{ always() && contains(format(',{0},', replace(inputs.ci_steps, ' ', '')), ',deploy,') && 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 }}
branch_name: ${{ github.ref_name }}
pm2_id: ${{ inputs.pm2_id }}
app_path_beta: ${{ inputs.app_path_beta }}
app_path_staging: ${{ inputs.app_path_staging }}
app_path_prod: ${{ inputs.app_path_prod }}
secrets:
BETA_SERVER_HOST: ${{ secrets.BETA_SERVER_HOST }}
BETA_SERVER_PORT: ${{ secrets.BETA_SERVER_PORT }}
BETA_SERVER_USERNAME: ${{ secrets.BETA_SERVER_USERNAME }}
BETA_SERVER_PASSWORD: ${{ secrets.BETA_SERVER_PASSWORD }}
BETA_SERVER_KEY: ${{ secrets.BETA_SERVER_KEY }}
STAGING_SERVER_HOST: ${{ secrets.STAGING_SERVER_HOST }}
STAGING_SERVER_PORT: ${{ secrets.STAGING_SERVER_PORT }}
STAGING_SERVER_USERNAME: ${{ secrets.STAGING_SERVER_USERNAME }}
STAGING_SERVER_PASSWORD: ${{ secrets.STAGING_SERVER_PASSWORD }}
STAGING_SERVER_KEY: ${{ secrets.STAGING_SERVER_KEY }}
PROD_SERVER_HOST: ${{ secrets.PROD_SERVER_HOST }}
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 }}