Add .gitea/workflows/ci.yml

This commit is contained in:
2026-04-07 07:51:41 +00:00
parent 7d5ed3ec51
commit e9858cbb5d

134
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,134 @@
name: Central CI
on:
workflow_call:
inputs:
run_build:
type: boolean
default: true
run_sonar:
type: boolean
default: true
run_deploy:
type: boolean
default: false
wait_for_quality_gate:
type: boolean
default: true
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
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: inputs.run_build == true
uses: <YOUR_GITEA_URL>/wdipl-actions/.gitea/workflows/build.yml@main
with:
tech_stack: ${{ inputs.tech_stack }}
build_command: ${{ inputs.build_command }}
# 🔍 SONAR
sonar:
if: inputs.run_sonar == true
needs: build
uses: <YOUR_GITEA_URL>/wdipl-actions/.gitea/workflows/sonar.yml@main
with:
wait_for_quality_gate: ${{ inputs.wait_for_quality_gate }}
secrets:
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# 🚀 DEPLOY
deploy:
if: inputs.run_deploy == true
needs: [build, sonar]
uses: <YOUR_GITEA_URL>/wdipl-actions/.gitea/workflows/deploy.yml@main
with:
tech_stack: ${{ inputs.tech_stack }}
deploy_command: ${{ inputs.deploy_command }}
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:
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 }}