generated from pagopa/template-java-spring-microservice
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (76 loc) · 2.42 KB
/
gpd_get_fdr.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: getGPDFdR
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
inputs:
environment:
required: true
type: choice
options:
- prod
- uat
default: prod
flow_date:
required: true
type: choice
options:
- all
- yesterday
default: yesterday
notify:
description: 'notify report results'
required: false
type: boolean
default: true
jobs:
run-script:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
cd ./python/gpd-get-fdr
pip install -r requirements.txt
- name: Run Python Script
env:
FR_NEW_CONN_SUBKEY_PRD: ${{ secrets.FR_NEW_CONN_SUBKEY_PRD }}
FR_NEW_CONN_SUBKEY_UAT: ${{ secrets.FR_NEW_CONN_SUBKEY_UAT }}
FR_SA_CONN_STRING_PRD: ${{ secrets.FR_SA_CONN_STRING_PRD }}
FR_SA_CONN_STRING_UAT: ${{ secrets.FR_SA_CONN_STRING_UAT }}
FR_DATE: ${{inputs.flow_date || 'yesterday'}}
FR_ENV: ${{inputs.environment || 'prod'}}
FR_CSV_NAME: "ec-list_updated_prod.csv"
PYTHONUNBUFFERED: "1"
run: |
cd ./python/gpd-get-fdr
python get-flows.py
- name: Create failure payload
if: ${{ failure() && inputs.notify }}
run: |
echo '{
"text": "❌ *Errore* Il workflow è fallito.",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "❌ *Si è verificato un errore durante l'esecuzione del job*"
}
}
]
}' > ./python/gpd-get-fdr/payload.json
- name: Send notification to Slack
id: slack
if: ${{ (success() || failure()) && (inputs.notify != 'false' || github.event_name == 'schedule') }}
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 #v1.24.0
with:
payload-file-path: "./python/gpd-get-fdr/payload.json"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK