-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (60 loc) · 1.91 KB
/
master.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
name: Update external sources
# Controls when the action will run.
on:
push:
branches:
- 'master'
schedule:
- cron: '54 */4 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
GIT_NAME: '${{ secrets.GIT_NAME }}'
GIT_EMAIL: '${{ secrets.GIT_EMAIL }}'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
jobs:
scheduler:
name: Trigger action
runs-on: '${{ matrix.os }}'
strategy:
fail-fast: false
matrix:
python_version:
- '3.12'
os:
- ubuntu-24.04
steps:
- uses: actions/checkout@main #Obviously yet another american...
name: Clone repository
with:
token: '${{ secrets.GITHUB_TOKEN }}'
- name: Setup PHP
uses: shivammathur/setup-php@main
with:
php-version: '8.4'
extensions: mysql, imagick
- name: Install requirements
run: |
sudo bash "${{ github.workspace }}/scripts/dependencies.sh"
- name: Install mypdns
run: |
pip install --break-system-packages --no-cache mypdns
- name: Import IP based blacklists
run: bash "${{ github.workspace }}/scripts/import.sh"
- name: Download and convert dumb hosts to plain data
run: php -f "${{ github.workspace }}/scripts/converter.php"
- name: Update active source list
run: bash "${{ github.workspace }}/scripts/update_active_lists.sh"
- name: Commit changes
run: |
tag=$(date +'day: %j of year %Y %H:%M:%S')
git config --local user.email "$GIT_EMAIL"
git config --local user.name "$GIT_NAME"
git add .
git commit -m "Committed new lists $tag" -a
git pull --rebase
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}