-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathstaging-production.yml
More file actions
67 lines (60 loc) · 1.74 KB
/
staging-production.yml
File metadata and controls
67 lines (60 loc) · 1.74 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Staging and Production deployment workflow
# - Push to develop → deploys to staging
# - Push to main → deploys to production (requires approval)
#
# Required secrets (configure per environment in GitHub):
# Staging environment:
# - GIGALIXIR_EMAIL
# - GIGALIXIR_API_KEY
# Production environment:
# - GIGALIXIR_EMAIL
# - GIGALIXIR_API_KEY
#
# Setup:
# 1. Go to Settings → Environments
# 2. Create "staging" and "production" environments
# 3. Add secrets to each environment
# 4. Optionally add required reviewers to production
name: Deploy
on:
push:
branches:
- main
- develop
# Prevent concurrent deployments to the same environment
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: false
jobs:
deploy-staging:
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
environment:
name: staging
url: https://my-app-staging.gigalixirapp.com
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Deploy to Staging
uses: gigalixir/gigalixir-action@v1
with:
gigalixir_email: ${{ secrets.GIGALIXIR_EMAIL }}
gigalixir_api_key: ${{ secrets.GIGALIXIR_API_KEY }}
app_name: my-app-staging
deploy-production:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment:
name: production
url: https://my-app.gigalixirapp.com
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Deploy to Production
uses: gigalixir/gigalixir-action@v1
with:
gigalixir_email: ${{ secrets.GIGALIXIR_EMAIL }}
gigalixir_api_key: ${{ secrets.GIGALIXIR_API_KEY }}
app_name: my-app-prod