-
-
Notifications
You must be signed in to change notification settings - Fork 3
80 lines (67 loc) · 2.34 KB
/
auto_retrieve.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
79
80
name: Automated retrieval
run-name: Automated retrieval
on:
workflow_dispatch:
schedule:
- cron: '0 16 * * *'
permissions:
contents: write
jobs:
# This condition lets the job run even if any of the previous jobs failed
# ${{ ! cancelled() }}
# This condition prevents the job from running if the test job failed
# ${{ needs.test-functions.result == 'success' }}
test-functions:
uses: ./.github/workflows/test_functions.yml
build-nsfw:
needs: test-functions
if: ${{ ! cancelled() }}
uses: ./.github/workflows/build_nsfw.yml
retrieve-domains:
needs: [test-functions, build-nsfw]
if: ${{ ! cancelled() && needs.test-functions.result == 'success' }}
uses: ./.github/workflows/retrieve_domains.yml
secrets: inherit
validate:
needs: [test-functions, retrieve-domains]
if: ${{ ! cancelled() && needs.test-functions.result == 'success' }}
uses: ./.github/workflows/validate_domains.yml
secrets: inherit
check-dead:
needs: [test-functions, validate]
if: ${{ ! cancelled() && needs.test-functions.result == 'success' }}
uses: ./.github/workflows/check_dead.yml
check-unparked:
needs: [test-functions, check-dead]
if: ${{ ! cancelled() && needs.test-functions.result == 'success' }}
uses: ./.github/workflows/check_unparked.yml
build:
needs: [test-functions, check-unparked]
if: ${{ ! cancelled() && needs.test-functions.result == 'success' }}
uses: ./.github/workflows/build_lists.yml
prune-logs:
needs: build
if: ${{ ! cancelled() }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- name: Prune logs
run: |
# 250,000 is enough for a month's worth of logs.
bash scripts/tools.sh --prune-lines config/domain_log.csv 250000
bash scripts/tools.sh --prune-lines config/source_log.csv 10000
- name: Push
run: |
git config user.email ${{ vars.GIT_EMAIL }}
git config user.name ${{ vars.GIT_USERNAME }}
git add .
git diff-index --quiet HEAD || git commit -m "CI: prune logs"
git push -q
update-readme:
needs: [build, prune-logs]
# Run only if build was successful
if: ${{ ! cancelled() && needs.build.result == 'success' }}
uses: ./.github/workflows/update_readme.yml