-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (60 loc) · 2.01 KB
/
deploy-site.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
name: Deploy Site
on:
workflow_call:
inputs:
stage:
description: 'App stage to deploy (development|staging|production).'
default: 'development'
type: string
workflow_dispatch:
inputs:
stage:
description: 'App stage to deploy (development|staging|production).'
default: 'development'
type: environment
env:
# notify defaults
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_ICON: ${{ secrets.SLACK_ICON }}
SLACK_CHANNEL: 'core'
SLACK_USERNAME: 'CrisisCleanup Bot'
SLACK_COLOR: '#fece09'
SLACK_TITLE: 'New Release'
SLACK_MESSAGE: "Heads up, I'm currently releasing to ${{ inputs.stage }}! You can watch my progress at the url above."
jobs:
notify:
name: Notify Deploy >> ${{ inputs.stage }}
runs-on: ubuntu-latest
if: inputs.stage == 'staging' || inputs.stage == 'production' || inputs.stage == 'production-au'
steps:
- uses: rtCamp/action-slack-notify@v2
deploy-site:
name: Deploy
secrets: inherit
uses: CrisisCleanup/infrastructure/.github/workflows/deploy-crisiscleanup-site.yml@main
with:
environment: ${{ inputs.stage }}
notify-success:
name: Notify Success >> ${{ inputs.stage }}
runs-on: ubuntu-latest
needs: [deploy-site]
if: inputs.stage == 'staging' || inputs.stage == 'production' || inputs.stage == 'production-au'
environment:
name: ${{ inputs.stage }}
url: ${{ vars.VITE_APP_BASE_URL }}
env:
SLACK_TITLE: 'Live Release'
SLACK_MESSAGE: ':rocket: ${{ inputs.stage }} is live! Check it out at: ${{ vars.VITE_APP_BASE_URL }}'
steps:
- uses: rtCamp/action-slack-notify@v2
notify-failure:
name: Notify Failure >> ${{ inputs.stage }}
needs: [deploy-site]
runs-on: ubuntu-latest
if: always() && failure()
env:
SLACK_COLOR: '#D94F37'
SLACK_TITLE: 'Deploy Failed!'
SLACK_MESSAGE: 'Failed to deploy ${{ inputs.stage }}... someone broke something! :frowning:'
steps:
- uses: rtCamp/action-slack-notify@v2