From 3abb7e0ad142015c6ae49f9fda97bee779faf46c Mon Sep 17 00:00:00 2001 From: cialloo Date: Sun, 5 Oct 2025 17:48:15 +0800 Subject: [PATCH] Update CI/CD workflows to enable automatic triggers after successful builds --- .github/workflows/cd.yml | 12 ++++++++++-- .github/workflows/ci.yml | 7 +++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1f60d9c..597f020 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,11 +1,17 @@ # Continuous Deployment Workflow # This workflow deploys your application to Kubernetes cluster -# Trigger: Manual dispatch only +# Trigger: After successful CI build or manual dispatch name: CD - Deploy to Kubernetes -# Trigger configuration - manual dispatch only +# Trigger configuration - automatic after CI success, manual dispatch available on: + workflow_run: + workflows: ["CI - Build and Push"] + types: + - completed + branches: + - dev workflow_dispatch: inputs: image_tag: @@ -50,6 +56,8 @@ jobs: deploy: name: Deploy to Kubernetes runs-on: ubuntu-latest + # Only run if CI workflow succeeded (for workflow_run trigger) + if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} steps: # Step 1: Checkout code from repository diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3812571..8571c4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,14 @@ # Continuous Integration Workflow # This workflow builds and pushes Docker images to your private registry -# Trigger: Manual dispatch only +# Trigger: Push to dev branch or manual dispatch name: CI - Build and Push -# Trigger configuration - manual dispatch only +# Trigger configuration - automatic on dev push, manual dispatch available on: + push: + branches: + - dev workflow_dispatch: inputs: image_tag: