-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 1.24 KB
/
main.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
# You can name this whatever you want
name: daily
# You will get an error on the automatic updates committing
# if you do not have this line
# You didn't need it before, which is why a lot of yml job files
# you see will not have it (but you need it now!!!)
permissions:
contents: write
# The 'on' section is about when this is run
# workflow_dispatch makes there be a button on GitHub to let you run it manually
# schedule and cron make it run at certain frequencies
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'
jobs:
daily:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install all necessary packages
run: pip install jupyter lxml pandas requests beautifulsoup4 html5lib
- name: Scraping today's data
run: jupyter nbconvert --to notebook --execute "Scraper.ipynb" --stdout
- name: Commit and push any changes
run: |-
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push