refactor: remove input parameters from CI and CD workflows
This commit is contained in:
31
.github/workflows/cd.yml
vendored
31
.github/workflows/cd.yml
vendored
@@ -12,34 +12,13 @@ on:
|
||||
branches:
|
||||
- dev
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
image_tag:
|
||||
description: 'Docker image tag to deploy (e.g., latest, v1.0.0)'
|
||||
required: false
|
||||
default: 'latest'
|
||||
type: string
|
||||
namespace:
|
||||
description: 'Kubernetes namespace (e.g., production, staging)'
|
||||
required: false
|
||||
default: 'default'
|
||||
type: string
|
||||
ingress_host:
|
||||
description: 'Ingress host domain (e.g., stats-api.example.com)'
|
||||
required: false
|
||||
default: 'www.cialloo.com'
|
||||
type: string
|
||||
force_restart:
|
||||
description: 'Force rollout restart (restarts pods even if no changes)'
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
|
||||
env:
|
||||
# Kubernetes configuration
|
||||
KUBECONFIG_DATA: ${{ secrets.KUBECONFIG_DATA }}
|
||||
KUBERNETES_URL: ${{ secrets.KUBERNETES_URL }}
|
||||
KUBERNETES_NAMESPACE: ${{ inputs.namespace || secrets.KUBERNETES_NAMESPACE }}
|
||||
KUBERNETES_INGRESS_HOST: ${{ inputs.ingress_host || secrets.KUBERNETES_INGRESS_HOST }}
|
||||
KUBERNETES_NAMESPACE: ${{ secrets.KUBERNETES_NAMESPACE }}
|
||||
KUBERNETES_INGRESS_HOST: ${{ secrets.KUBERNETES_INGRESS_HOST }}
|
||||
|
||||
# Container registry configuration
|
||||
CONTAINER_REGISTRY_URL: ${{ secrets.CONTAINER_REGISTRY_URL }}
|
||||
@@ -47,8 +26,8 @@ env:
|
||||
CONTAINER_REGISTRY_NAMESPACE: ${{ secrets.CONTAINER_REGISTRY_NAMESPACE }}
|
||||
CONTAINER_REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
|
||||
CONTAINER_IMAGE_NAME: ${{ secrets.CONTAINER_IMAGE_NAME }}
|
||||
CONTAINER_IMAGE_TAG: ${{ inputs.image_tag || 'latest' }}
|
||||
FORCE_RESTART: ${{ inputs.force_restart }}
|
||||
CONTAINER_IMAGE_TAG: ${{ secrets.CONTAINER_IMAGE_TAG }}
|
||||
FORCE_RESTART: ${{ secrets.KUBERNETES_FORCE_RESTART }}
|
||||
|
||||
# Application configuration
|
||||
DATABASE_DSN: ${{ secrets.DATABASE_DSN }}
|
||||
@@ -57,7 +36,7 @@ jobs:
|
||||
deploy:
|
||||
name: Deploy to Kubernetes
|
||||
runs-on: ubuntu-latest
|
||||
# Only run if CI workflow succeeded (for workflow_run trigger)
|
||||
# Only run if CI workflow succeeded or manually dispatched
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
|
||||
|
||||
steps:
|
||||
|
||||
Reference in New Issue
Block a user