Nike-Parser #445
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 bs4 | |
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 }} |