Skip to content

Nike-Parser

Nike-Parser #763

Workflow file for this run

# 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/set-timezone@v1.0
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 }}