-
Notifications
You must be signed in to change notification settings - Fork 50
33 lines (30 loc) · 1.07 KB
/
deploy.yml
File metadata and controls
33 lines (30 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Deployment
on:
workflow_run:
workflows: ["Docker Build & Push"]
types:
- completed
branches:
- main
- develop
jobs:
deploy-staging:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'develop' }}
runs-on: ubuntu-latest
environment: staging
steps:
- name: Deploy to Staging
run: |
echo "Deploying to Staging environment..."
# Add your staging deployment commands here (e.g., helm upgrade, kubectl apply, ssh/scp)
# Example: ssh user@staging-server "docker-compose pull && docker-compose up -d"
deploy-production:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }}
runs-on: ubuntu-latest
environment: production
steps:
- name: Deploy to Production
run: |
echo "Deploying to Production environment..."
# Add your production deployment commands here
# Note: This job requires manual approval via GitHub Environment settings.