-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (41 loc) · 1.54 KB
/
scrape-vn-auto.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
# This is a basic workflow to help you get started with Actions
name: scrape-vn-auto
# Controls when the workflow will run
on:
schedule:
- cron: 33 21 * * * # runs once a day at 21:44 UTC (04:44 ICT)
workflow_dispatch:
concurrency:
group: scrape-and-schedule
cancel-in-progress: false
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: checkout repo content
uses: actions/checkout@v4 # checkout the repository content to GitHub runner.
- name: setup python
uses: actions/setup-python@v5
with:
python-version: 3.9.6
- name: setup dependencies
working-directory: ./mcd-bs4-vn
run: |
pip install -r requirements.txt
playwright install firefox
- name: execute py script # run mcd-bs4-vn.py to get the latest data
working-directory: ./mcd-bs4-vn
run: |
python mcd-pwp-vn.py
- name: Commit and push if it changed
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add -A
timestamp=$(date -u)
git commit -m "Scraped: [${timestamp}] mcd-pwp-vn (auto)"
git push "https://${GITHUB_ACTOR}:${TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD || exit 0