-
-
Notifications
You must be signed in to change notification settings - Fork 101
78 lines (63 loc) · 1.7 KB
/
run-crawler.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
name: Run scanner
on:
push:
branches: [ "master" ]
workflow_dispatch:
schedule:
- cron: '0 17 * * *'
permissions:
contents: write
actions: write
jobs:
build:
runs-on: ubuntu-latest
env:
cache-key: crawler-cache-shizuku
steps:
- uses: actions/checkout@v3
with:
repository: timschneeb/app-crawler
- uses: actions/checkout@v3
with:
repository: timschneeb/awesome-shizuku
path: './list'
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Restore cache
id: cache-restore
uses: actions/cache/restore@v3
with:
path: cache/
key: ${{ env.cache-key }}
- name: Run crawler
env:
GITHUB_AUTH: ${{ secrets.GH_PAT }}
SUMMARY_FILE: "list/pages/TODO.md"
run: |
python main.py ./list
cat ./list/pages/TODO.md >> $GITHUB_STEP_SUMMARY
- name: Delete previous cache
if: ${{ steps.cache-restore.outputs.cache-hit }}
continue-on-error: true
run: |
cd list/
gh extension install actions/gh-actions-cache
gh actions-cache delete "${{ env.cache-key }}" --confirm
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Save cache
uses: actions/cache/save@v3
with:
path: cache/
key: ${{ env.cache-key }}
- name: Publish summary changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: ./list
commit_message: Update TODO.md
file_pattern: pages/TODO.md