-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (73 loc) · 2.47 KB
/
Copy pathdeployment-workflow-call.yml
File metadata and controls
75 lines (73 loc) · 2.47 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
68
69
70
71
72
73
74
75
on:
workflow_call:
inputs:
environment:
description: 'Environment to be used when running the workflow'
required: true
type: string
release_tag:
description: 'Environment to be used when running the workflow'
required: false
type: string
jobs:
prod-deploy:
if: inputs.environment == 'production'
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
strategy:
matrix:
node-version: [16.x]
env:
REACT_APP_ENV: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.release_tag }}
- name: Deploying Claims to ${{ inputs.environment }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
stage-deploy:
if: inputs.environment == 'stage'
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
strategy:
matrix:
node-version: [16.x]
env:
REACT_APP_ENV: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v3
- name: Deploying Claims to ${{ inputs.environment }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: "Trigger Stage Amplify Build"
run: |
curl -X POST -d {} "https://webhooks.amplify.eu-central-1.amazonaws.com/prod/webhooks?id=${{ secrets.AMPLIFY_WEBHOOK_ID }}&token=${{ secrets.AMPLIFY_WEBHOOK_TOKEN }}&operation=startbuild" -H "Content-Type:application/json"
qa-deploy:
if: inputs.environment == 'qa'
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
strategy:
matrix:
node-version: [16.x]
env:
REACT_APP_ENV: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v3
with:
repository: malithmcr/videco
token: ${{ secrets.ACCESS_GITHUB_TOKEN }}
- name: "Trigger QA Amplify Build"
run: |
curl -X POST -d {} "https://webhooks.amplify.eu-central-1.amazonaws.com/prod/webhooks?id=${{ secrets.AMPLIFY_WEBHOOK_ID }}&token=${{ secrets.AMPLIFY_WEBHOOK_TOKEN }}&operation=startbuild" -H "Content-Type:application/json"
- uses: ravsamhq/notify-slack-action@v2
if: always()
with:
status: ${{ job.status }}
mention_users: "Malith"
mention_users_when: "failure,warnings"
footer: "Linked Repo <{repo_url}|{repo}> | <{workflow_url}|View Workflow>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}