genshin-wiki/.github/workflows/spider.yml

33 lines
876 B
YAML
Raw Permalink Normal View History

2023-08-21 12:54:36 +00:00
name: Genshin Data Spider
on:
workflow_dispatch:
jobs:
spider:
runs-on: ubuntu-latest
name: "Scrape Genshin Data"
steps:
2023-08-21 13:03:38 +00:00
- name: Checkout
uses: actions/checkout@v3.5.3
2023-08-21 12:54:36 +00:00
- name: Setup Python
uses: actions/setup-python@v4.7.0
with:
python-version: '3.11'
- name: Install Dependencies
run: |
2023-08-21 12:55:58 +00:00
python -m pip install --upgrade pip wheel setuptools
2023-08-21 12:54:36 +00:00
pip install --upgrade poetry
2023-08-21 13:12:40 +00:00
poetry config virtualenvs.create false
2023-08-21 12:54:36 +00:00
poetry install
- name: Run Spider
2023-08-21 13:16:16 +00:00
run: python run.py
2023-08-21 12:54:36 +00:00
- name: Commit and push
run: |-
2023-08-21 13:16:16 +00:00
git config --global user.email "bot@github.com" && git config --global user.name "Github-Bot"
2023-08-21 12:54:36 +00:00
git diff
2023-08-21 13:16:16 +00:00
git add ./out && git commit -m ":memo: update genshin data" || exit 0
2023-08-21 12:54:36 +00:00
git pull && git push