Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/conditional.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Conditional

on:
workflow_dispatch:
inputs:
environment:
description: "Target environment"
required: true
default: "staging"
type: choice
options:
- staging
- production

dry_run:
description: "Run without actually deploying"
required: false
default: false
type: boolean

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Always Run
run: echo "🔧 Starting workflow for ${{ github.event.inputs.environment }}"

- name: Dry Run Notice
if: ${{ github.event.inputs.dry_run == 'true' }}
run: echo "⚠️ This is a dry run — no changes will be made."

- name: Real Deployment
if: ${{ github.event.inputs.dry_run == 'false' }}
run: echo "🚀 Deploying to ${{ github.event.inputs.environment }}..."

- name: Production-only Notification
if: ${{ github.event.inputs.environment == 'production' }}
run: echo "📢 Notifying ops team: A production deployment just occurred.""