-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (46 loc) · 1.56 KB
/
run-python-script-datasetsinfo.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
# This workflow will install Python dependencies and run the script
name: run_datasetsinfo
on:
workflow_dispatch: # add run button in github
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run script
env:
PREPREFIX: ${{ secrets.PREPREFIX }}
USER_AGENT: ${{ secrets.USER_AGENT }}
MIXPANEL_API_SECRET: ${{ secrets.MIXPANEL_API_SECRET }}
MIXPANEL_PROJECT_ID: ${{ secrets.MIXPANEL_PROJECT_ID }}
MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }}
run: |
python get_datasets_info.py --output_dir=datasets_info
- name: Deploy 🚀
if: always()
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: datasets_info
target-folder: datasets_info
- name: Send mail
if: failure()
uses: dawidd6/action-send-mail@v3
with:
server_address: ${{secrets.EMAIL_SERVER}}
server_port: ${{secrets.EMAIL_PORT}}
username: ${{secrets.EMAIL_USERNAME}}
password: ${{secrets.EMAIL_PASSWORD}}
subject: "FAILED: ${{github.repository}} run job"
body: GitHub Actions run job for ${{github.repository}} failed!
to: ${{secrets.EMAIL_LIST}}
from: ${{secrets.EMAIL_FROM}}
content_type: text/html