-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (97 loc) · 3.72 KB
/
ImportData-Production.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Import data in production
on:
repository_dispatch:
types: [import-data-production]
schedule:
- cron: '0 4 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: yarn install
run: yarn install
- name: Import GroupeParlementaire
run: yarn start -g
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL_PRODUCTION }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_PRODUCTION }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_NOTIFICATION: ${{ secrets.SLACK_NOTIFICATION }}
NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_PROD }}
SUPABASE_ENV: Production
- name: Import Depute
run: yarn start -d
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL_PRODUCTION }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_PRODUCTION }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_NOTIFICATION: ${{ secrets.SLACK_NOTIFICATION }}
NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_PROD }}
SUPABASE_ENV: Production
- name: Import Activite
run: yarn start -a
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL_PRODUCTION }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_PRODUCTION }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_NOTIFICATION: ${{ secrets.SLACK_NOTIFICATION }}
NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_PROD }}
SUPABASE_ENV: Production
- name: Import OrganismeParlementaire
run: yarn start -o
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL_PRODUCTION }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_PRODUCTION }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_NOTIFICATION: ${{ secrets.SLACK_NOTIFICATION }}
NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_PROD }}
SUPABASE_ENV: Production
- name: Import Deputes_OrganismeParlementaire
run: yarn start -p
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL_PRODUCTION }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_PRODUCTION }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_NOTIFICATION: ${{ secrets.SLACK_NOTIFICATION }}
NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_PROD }}
SUPABASE_ENV: Production
- name: Upload logs as artifact
uses: actions/upload-artifact@v1
if: always()
with:
name: logs
path: logs
- uses: 8398a7/action-slack@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()
with:
status: custom
fields: workflow,job,commit
custom_payload: |
{
username: 'Github Actions',
icon_emoji: ':rocket:',
attachments: [
{
color: '${{ job.status }}' === 'success' ? '#28a745' : '${{ job.status }}' === 'failure' ? '#dc3545' : '#ffc107',
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": '${{ job.status }}' === 'success' ? "Data successfully imported in Supabase Production :sunglasses::tada:" : "Error while importing data in Supabase Production"
}
}
]
}
]
}