File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Multi-Environment Deployment
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ environment :
7+ description : " Choose environment"
8+ required : true
9+ default : " dev"
10+
11+ jobs :
12+ deploy :
13+ name : 🚀 Deploy Application
14+ runs-on : ubuntu-latest
15+
16+ environment :
17+ name : ${{ github.event.inputs.environment }}
18+ url : https://myapp-${{ github.event.inputs.environment }}.example.com
19+
20+ steps :
21+ - uses : actions/checkout@v4
22+
23+ - name : Print environment info
24+ run : |
25+ echo "Deploying to: ${{ github.event.inputs.environment }}"
26+ echo "Triggered by: ${{ github.actor }}"
27+
28+ - name : Use environment secret
29+ env :
30+ API_KEY : ${{ secrets.API_KEY }}
31+ run : echo "Using secret API key: ${API_KEY:0:4}****"
32+
33+ - name : Simulate deployment
34+ run : echo "Deploying app to ${{ github.event.inputs.environment }}..."
You can’t perform that action at this time.
0 commit comments