5
5
# pull_request:
6
6
# branches: [ master ]
7
7
push :
8
- branches :
9
- - master
8
+ branches :
9
+ - master
10
10
11
11
jobs :
12
12
deploy_to_dev :
@@ -15,138 +15,138 @@ jobs:
15
15
ENV : " dev"
16
16
17
17
steps :
18
- # This Clean step simply checks if there's already a workflow running from the last
19
- # commit and cancels it if there is. This helps us save on cloud cost in the long run.
20
- # See https://github.com/rokroskar/workflow-run-cleanup-action for more information.
21
- - name : Clean
22
-
23
- env :
24
- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
25
- if : " github.ref != 'refs/heads/master'"
26
- - name : Checkout Repo
27
- uses : actions/checkout@v2
28
- - name : Auth with Gcloud
29
- uses : google-github-actions/auth@v0
30
- with :
31
- credentials_json : ${{ secrets.GCP_DEV_SA_KEY }}
32
- - name : Set up Gcloud SDK
33
- uses : google-github-actions/setup-gcloud@v0
34
- with :
35
- project_id : zesty-dev
36
- - name : Set up Node
37
- uses : actions/setup-node@v2
38
- with :
39
- node-version : " 16.5.0"
40
- cache : " npm"
41
- cache-dependency-path : package-lock.json
42
- - name : Install Dependencies
43
- run : npm install
44
- - name : Build
45
- run : npm run build- dev
46
- - name : Deploy to Dev
47
- run : gcloud app deploy app.yaml --quiet --project zesty-dev
48
- - name : Post Successful Dev Deploy Notification To Slack
49
- uses : rtCamp/action-slack-notify@v2
50
- env :
51
- SLACK_CHANNEL : devops
52
- SLACK_COLOR : ${{ job.status }}
53
- SLACK_ICON : https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png
54
- SLACK_MESSAGE : |
55
- Use :eyes: to signal you have seen this message.
56
- Use :white_check_mark: to signal you have successfully manually tested the deployed changes.
57
- Use :x: to signal manual tests on deployed changes were unsuccessful and start a thread under this alert describing your remediation steps.
58
- SLACK_TITLE : Successfully Deployed manager-ui to Dev
59
- SLACK_USERNAME : Deploy Bot
60
- SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
18
+ # This Clean step simply checks if there's already a workflow running from the last
19
+ # commit and cancels it if there is. This helps us save on cloud cost in the long run.
20
+ # See https://github.com/rokroskar/workflow-run-cleanup-action for more information.
21
+ - name : Clean
22
+
23
+ env :
24
+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
25
+ if : " github.ref != 'refs/heads/master'"
26
+ - name : Checkout Repo
27
+ uses : actions/checkout@v2
28
+ - name : Auth with Gcloud
29
+ uses : google-github-actions/auth@v0
30
+ with :
31
+ credentials_json : ${{ secrets.GCP_DEV_SA_KEY }}
32
+ - name : Set up Gcloud SDK
33
+ uses : google-github-actions/setup-gcloud@v0
34
+ with :
35
+ project_id : zesty-dev
36
+ - name : Set up Node
37
+ uses : actions/setup-node@v2
38
+ with :
39
+ node-version : " 16.5.0"
40
+ cache : " npm"
41
+ cache-dependency-path : package-lock.json
42
+ - name : Install Dependencies
43
+ run : npm install
44
+ - name : Build
45
+ run : npm run build: dev
46
+ - name : Deploy to Dev
47
+ run : gcloud app deploy app.yaml --quiet --project zesty-dev
48
+ - name : Post Successful Dev Deploy Notification To Slack
49
+ uses : rtCamp/action-slack-notify@v2
50
+ env :
51
+ SLACK_CHANNEL : devops
52
+ SLACK_COLOR : ${{ job.status }}
53
+ SLACK_ICON : https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png
54
+ SLACK_MESSAGE : |
55
+ Use :eyes: to signal you have seen this message.
56
+ Use :white_check_mark: to signal you have successfully manually tested the deployed changes.
57
+ Use :x: to signal manual tests on deployed changes were unsuccessful and start a thread under this alert describing your remediation steps.
58
+ SLACK_TITLE : Successfully Deployed manager-ui to Dev
59
+ SLACK_USERNAME : Deploy Bot
60
+ SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
61
61
cancel_workflow_if_dev_deploy_failed :
62
- runs-on : ubuntu-latest
63
- if : ${{ failure() }}
64
- needs :
65
- - deploy_to_dev
66
- steps :
62
+ runs-on : ubuntu-latest
63
+ if : ${{ failure() }}
64
+ needs :
65
+ - deploy_to_dev
66
+ steps :
67
67
- name : Post Failed Dev Deploy Notification To Slack
68
68
uses : rtCamp/action-slack-notify@v2
69
69
env :
70
70
SLACK_CHANNEL : devops
71
- SLACK_COLOR : ' #FF0000'
71
+ SLACK_COLOR : " #FF0000"
72
72
SLACK_ICON : https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png
73
- SLACK_MESSAGE : ' PR merge by ${{ github.actor }} has failed to deploy to dev.'
73
+ SLACK_MESSAGE : " PR merge by ${{ github.actor }} has failed to deploy to dev."
74
74
SLACK_TITLE : Dev Deployment Failed for manager-ui
75
75
SLACK_USERNAME : Deploy Bot
76
76
SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
77
77
- name : Cancel current workflow run
78
78
uses : actions/github-script@v4
79
79
with :
80
- script : |
81
- github.actions.cancelWorkflowRun({
82
- owner: context.repo.owner,
83
- repo: context.repo.repo,
84
- run_id: context.runId
85
- })
80
+ script : |
81
+ github.actions.cancelWorkflowRun({
82
+ owner: context.repo.owner,
83
+ repo: context.repo.repo,
84
+ run_id: context.runId
85
+ })
86
86
deploy_to_stage :
87
87
runs-on : ubuntu-latest
88
88
env :
89
89
ENV : " stage"
90
90
needs :
91
- - deploy_to_dev
91
+ - deploy_to_dev
92
92
93
93
steps :
94
- # This Clean step simply checks if there's already a workflow running from the last
95
- # commit and cancels it if there is. This helps us save on cloud cost in the long run.
96
- # See https://github.com/rokroskar/workflow-run-cleanup-action for more information.
97
- - name : Clean
98
-
99
- env :
100
- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
101
- if : " github.ref != 'refs/heads/master'"
102
- - name : Checkout Repo
103
- uses : actions/checkout@v2
104
- - name : Auth with Gcloud
105
- uses : google-github-actions/auth@v0
106
- with :
107
- credentials_json : ${{ secrets.GCP_SA_KEY }}
108
- - name : Set up Gcloud SDK
109
- uses : google-github-actions/setup-gcloud@v0
110
- with :
111
- project_id : zesty-stage
112
- - name : Set up Node
113
- uses : actions/setup-node@v2
114
- with :
115
- node-version : " 16.5.0"
116
- cache : " npm"
117
- cache-dependency-path : package-lock.json
118
- - name : Install Dependencies
119
- run : npm install
120
- - name : Build
121
- run : npm run build- stage
122
- - name : Deploy to Staging
123
- run : gcloud app deploy app.yaml --quiet --project zesty-stage
124
- - name : Post Successful Stage Deploy Notification To Slack
125
- uses : rtCamp/action-slack-notify@v2
126
- env :
127
- SLACK_CHANNEL : devops
128
- SLACK_COLOR : ${{ job.status }}
129
- SLACK_ICON : https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png
130
- SLACK_MESSAGE : |
131
- Use :eyes: to signal you have seen this message.
132
- Use :white_check_mark: to signal you have successfully manually tested the deployed changes.
133
- Use :x: to signal manual tests on deployed changes were unsuccessful and start a thread under this alert describing your remediation steps.
134
- SLACK_TITLE : Successfully Deployed manager-ui to Stage
135
- SLACK_USERNAME : Deploy Bot
136
- SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
94
+ # This Clean step simply checks if there's already a workflow running from the last
95
+ # commit and cancels it if there is. This helps us save on cloud cost in the long run.
96
+ # See https://github.com/rokroskar/workflow-run-cleanup-action for more information.
97
+ - name : Clean
98
+
99
+ env :
100
+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
101
+ if : " github.ref != 'refs/heads/master'"
102
+ - name : Checkout Repo
103
+ uses : actions/checkout@v2
104
+ - name : Auth with Gcloud
105
+ uses : google-github-actions/auth@v0
106
+ with :
107
+ credentials_json : ${{ secrets.GCP_SA_KEY }}
108
+ - name : Set up Gcloud SDK
109
+ uses : google-github-actions/setup-gcloud@v0
110
+ with :
111
+ project_id : zesty-stage
112
+ - name : Set up Node
113
+ uses : actions/setup-node@v2
114
+ with :
115
+ node-version : " 16.5.0"
116
+ cache : " npm"
117
+ cache-dependency-path : package-lock.json
118
+ - name : Install Dependencies
119
+ run : npm install
120
+ - name : Build
121
+ run : npm run build: stage
122
+ - name : Deploy to Staging
123
+ run : gcloud app deploy app.yaml --quiet --project zesty-stage
124
+ - name : Post Successful Stage Deploy Notification To Slack
125
+ uses : rtCamp/action-slack-notify@v2
126
+ env :
127
+ SLACK_CHANNEL : devops
128
+ SLACK_COLOR : ${{ job.status }}
129
+ SLACK_ICON : https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png
130
+ SLACK_MESSAGE : |
131
+ Use :eyes: to signal you have seen this message.
132
+ Use :white_check_mark: to signal you have successfully manually tested the deployed changes.
133
+ Use :x: to signal manual tests on deployed changes were unsuccessful and start a thread under this alert describing your remediation steps.
134
+ SLACK_TITLE : Successfully Deployed manager-ui to Stage
135
+ SLACK_USERNAME : Deploy Bot
136
+ SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
137
137
post_failed_stage_deploy_notification_to_slack :
138
- runs-on : ubuntu-latest
139
- if : ${{ failure() }}
140
- needs :
141
- - deploy_to_stage
142
- steps :
138
+ runs-on : ubuntu-latest
139
+ if : ${{ failure() }}
140
+ needs :
141
+ - deploy_to_stage
142
+ steps :
143
143
- name : Post Failed Staging Deploy Notification To Slack
144
144
uses : rtCamp/action-slack-notify@v2
145
145
env :
146
146
SLACK_CHANNEL : devops
147
- SLACK_COLOR : ' #FF0000'
147
+ SLACK_COLOR : " #FF0000"
148
148
SLACK_ICON : https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png
149
- SLACK_MESSAGE : ' PR merge by ${{ github.actor }} has failed to deploy to staging.'
149
+ SLACK_MESSAGE : " PR merge by ${{ github.actor }} has failed to deploy to staging."
150
150
SLACK_TITLE : Staging Deployment Failed for manager-ui
151
151
SLACK_USERNAME : Deploy Bot
152
- SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
152
+ SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
0 commit comments