-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (64 loc) · 2.15 KB
/
migrate.yaml
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
name: migrate
on:
push:
branches:
- master
paths:
- 'database/**'
jobs:
migrate:
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials from github actions secrets
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-1
- name: Run Migrate CodeBuild
uses: aws-actions/[email protected]
with:
project-name: treasure-2020-b-migrate
- name: workflow finished
uses: 8398a7/[email protected]
with:
status: ${{ job.status }}
fields: repo,commit,message,author,job,took,workflow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()
- name: workflow finished
uses: 8398a7/[email protected]
with:
status: ${{ job.status }}
fields: repo,commit,message,author,job,took,workflow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.EBIS_SLACK_WEBHOOK_URL }}
if: always()
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%s%3N')"
- name: deployment tracking
env:
NR_INSIGHTS_API_KEY: ${{ secrets.NR_INSIGHTS_API_KEY }}
run: |
curl -k -H "Content-Type: application/json" \
-H "Api-Key: $NR_INSIGHTS_API_KEY" \
-X POST https://metric-api.newrelic.com/metric/v1 \
--data '[{ "metrics":[
{
"name": "deployment",
"type": "gauge",
"value": 1.0,
"timestamp": ${{ steps.date.outputs.date }},
"interval.ms": 1000,
"attributes": {
"group": "treasure-2020-b",
"app": "migrate",
"status": "${{ job.status }}",
"user": "${{ github.actor }}"
}
}
]}]'