diff --git a/.github/workflows/conditional.yml b/.github/workflows/conditional.yml new file mode 100644 index 0000000..3eac538 --- /dev/null +++ b/.github/workflows/conditional.yml @@ -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."" \ No newline at end of file