-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (79 loc) · 2.99 KB
/
production-deployment.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: 🚨 Production Deployment
on:
workflow_dispatch:
inputs:
deployment-type:
description: 'Deploy to production from which branch? (staging for release, main for hotfix)'
required: true
default: 'staging'
type: choice
options:
- 'main'
- 'staging'
jobs:
merge-release-content-to-production:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set Git config
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Set deployment type
run: |
echo "DEPLOYMENT_TYPE=${{ github.event.inputs.deployment-type }}" >> $GITHUB_ENV
shell: bash
- name: Merge ${{ env.DEPLOYMENT_TYPE }} into production
run: |
git fetch --unshallow
git checkout production
git pull origin production
git merge --no-ff origin/${{ env.DEPLOYMENT_TYPE }} -m "merge ${{ env.DEPLOYMENT_TYPE }} in production"
git push origin production
merge-release-content-to-production-us:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set Git config
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Set deployment type
run: |
echo "DEPLOYMENT_TYPE=${{ github.event.inputs.deployment-type }}" >> $GITHUB_ENV
shell: bash
- name: Merge ${{ env.DEPLOYMENT_TYPE }} into production-us
run: |
git fetch --unshallow
git checkout production-us
git pull origin production-us
git merge --no-ff origin/${{ env.DEPLOYMENT_TYPE }} -m "merge ${{ env.DEPLOYMENT_TYPE }} in production-us"
git push origin production-us
merge-release-content-to-production-uk:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set Git config
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Set deployment type
run: |
echo "DEPLOYMENT_TYPE=${{ github.event.inputs.deployment-type }}" >> $GITHUB_ENV
shell: bash
- name: Merge ${{ env.DEPLOYMENT_TYPE }} into production-uk
run: |
git fetch --unshallow
git checkout production-uk
git pull origin production-uk
git merge --no-ff origin/${{ env.DEPLOYMENT_TYPE }} -m "merge ${{ env.DEPLOYMENT_TYPE }} in production-uk"
git push origin production-uk