-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.23 KB
/
create.yml
File metadata and controls
48 lines (46 loc) · 1.23 KB
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
name: Run Script
on:
push:
branches: [ main ]
schedule:
- cron: '0 2 * * *'
jobs:
create:
if: ${{contains(github.event.head_commit.message, 'data update')
|| github.event_name == 'schedule'}}
name: create dataset
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: clean dir
run: |
git rm data/*
mkdir data
ls data
- name: Run script
run: |
python scripts/create_dataset.py
ls data
- name: check if successful, then commit
run: |
if [ -f done ]; then
echo "generated dataset successfully"
git config user.name github-actions
git config user.email github-actions@github.com
git add -A data/*
git commit -m "updated data"
git push
else
echo "failed to generate dataset"
fi