-
Notifications
You must be signed in to change notification settings - Fork 1
150 lines (128 loc) · 4.28 KB
/
status.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# This workflow determines the status of web API used by argopy, every 5 minutes
name: api-status
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '*/5 * * * *'
push:
branches: [ master ]
workflow_dispatch: # allows you to trigger the workflow run manually
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-and-report:
runs-on: ubuntu-latest
steps:
- name: Energy Estimation - Initialize
uses: green-coding-solutions/eco-ci-energy-estimation@v4.0-rc3
with:
task: start-measurement
company-uuid: ${{ secrets.CARBONDB_COMPANY_UUID }}
project-uuid: ${{ secrets.CARBONDB_PROJECT_UUID }}
machine-uuid: ${{ secrets.CARBONDB_MACHINE_UUID }}
continue-on-error: true
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: 'master'
# env:
# GIT_TRACE: 1
# GIT_CURL_VERBOSE: 1
- uses: actions/checkout@v4
- name: Save report
run: date +%s > last_update.txt
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install argopy
run: |
python -m pip install --upgrade pip
pwd
ls -l
pip install distributed aiohttp requests
pip install git+https://github.com/euroargodev/argopy.git@master
- name: Check API status
run: |
python check_save_status.py
ls -l
- name: Set env value for ARGOVIS
run: |
echo "ARGOVIS=$(cat ARGOVIS.txt)" >> $GITHUB_ENV
- name: Set env value for ERDDAP
run: |
echo "ERDDAP=$(cat ERDDAP.txt)" >> $GITHUB_ENV
- name: Set env value for GDAC
run: |
echo "GDAC=$(cat GDAC.txt)" >> $GITHUB_ENV
- name: Save API status online
uses: EndBug/add-and-commit@v9.1.4
with:
author_name: argobot-hub
author_email: argobot84@gmail.com
message: "Update status files"
add: "*.json --force"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Save report online
uses: EndBug/add-and-commit@v9.1.4
with:
author_name: argobot-hub
author_email: argobot84@gmail.com
message: 'Update report file'
add: "*.txt --force"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Fix self-signed error
# run: |
# echo "NODE_TLS_REJECT_UNAUTHORIZED='0'" >> $GITHUB_ENV
- name: Send ARGOVIS status by email
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 587
username: ${{secrets.MAIL_USERNAME}}
password: ${{secrets.MAIL_PASSWORD}}
subject: ${{env.ARGOVIS}}
body: Build job of ${{github.repository}} completed successfully!
to: ${{secrets.STATUSPAGE_ARGOVIS_EMAIL}}
from: argo-bot
ignore_cert: true
- name: Send ERDDAP status by email
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 587
username: ${{secrets.MAIL_USERNAME}}
password: ${{secrets.MAIL_PASSWORD}}
subject: ${{env.ERDDAP}}
body: Build job of ${{github.repository}} completed successfully!
to: ${{secrets.STATUSPAGE_ERDDAP_EMAIL}}
from: argo-bot
ignore_cert: true
- name: Send GDAC status by email
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 587
username: ${{secrets.MAIL_USERNAME}}
password: ${{secrets.MAIL_PASSWORD}}
subject: ${{env.GDAC}}
body: Build job of ${{github.repository}} completed successfully!
to: ${{secrets.STATUSPAGE_GDAC_EMAIL}}
from: argo-bot
ignore_cert: true
- name: Energy Estimation - Get Measurement
uses: green-coding-solutions/eco-ci-energy-estimation@v4.0-rc3
with:
task: get-measurement
label: 'argopy APIstatus'
continue-on-error: true
- name: Energy Estimation - Show Results
uses: green-coding-solutions/eco-ci-energy-estimation@v4.0-rc3
with:
task: display-results
pr-comment: false
send-data: true
continue-on-error: true