-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (72 loc) Β· 2.63 KB
/
nike-parser.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Nike-Parser
on:
schedule:
# update every day, 01:00 UTC => 10:00 (GMT+9)
# or
# updated every hours
- cron: '0 01 * * *'
#- cron: '*/60 * * * *'
# for test
# push:
# branches: [ "main" ]
workflow_dispatch: # μν λ μ€νμν¬ μ μλλ‘
jobs:
update:
runs-on: ubuntu-latest # μ°λΆν¬ μ΅μ λ²μ
strategy:
matrix:
python-version: [3.7] # νμ΄μ¬ 3.7 λ²μ μΌλ‘
node-version: [16]
steps:
# μν¬νλ‘μμ μ‘μΈμ€ν μ μλλ‘ μμ μ μ₯μλ₯Ό 체ν¬μμ
- uses: actions/checkout@v2
with:
token: ${{ secrets.TOKEN }}
persist-credentials: false
fetch-depth: 0
# νκ΅ μκ°μΌλ‘ λ³κ²½
- name: Set Timezone to +9 (GMT+9)
uses: szenius/[email protected]
with:
timezoneLinux: "Asia/Seoul"
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install python package # νμ΄μ¬ κ΄λ ¨ ν¨ν€μ§λ₯Ό μ€μΉ
run: |
python -m pip install --upgrade pip
pip install selenium
pip install webdriver_manager
pip install beautifulsoup4==4.11.1
pip install requests
pip install lxml
pip install datetime
pip install pytz
- name: Install ubuntu package # μ°λΆν¬ κ΄λ ¨ ν¨ν€μ§λ μ€μΉ
run: |
sudo apt-get install fonts-unfonts-core
sudo apt-get install fonts-unfonts-extra
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add
sudo apt-get install google-chrome-stable
wget https://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip
unzip ./chromedriver_linux64.zip
- name: Run Script # run.py μ€ν
run: |
cd parser
python run.py
- name: Set date in environment variable
run: echo "DATE=$(date +'%Y-%m-%d %H:%M GMT+9')" >> $GITHUB_ENV
- name: Add & Commit # Add Commit
uses: EndBug/add-and-commit@v9
with:
message: 'π€ Update Nike Models ${{ env.DATE }}'
author_name: 'GitHub-Actions-Bot'
add: '*.json'
push: false
- name: Push # Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.TOKEN }}