-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (31 loc) · 1 KB
/
spider_workflow.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
name: Spider Workflow
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 5" # 每周五的0点
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: List files
run: ls -R | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
- name: Run Python script
run: |
cd ./spider
pip install -r requirements.txt
python spider.py
- name: Commit changes
if: ${{ success() }}
run: |
git config --local user.name "${{ github.actor }}"
git config --local user.email "${{ github.actor }}@gmail.com"
git remote set-url origin https://${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git add -A
git commit -m "Add scraped data"
git push