-
Notifications
You must be signed in to change notification settings - Fork 27
54 lines (46 loc) · 1.55 KB
/
nordvpn-feed.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
name: Daily Nord VPN Servers Feed
on:
workflow_dispatch:
schedule:
- cron: "0 2 * * *" # Runs at 00:00 AM (UTC) everyday (Check https://crontab.tech/)
jobs:
download-nordvpnservers:
name: Download Nord VPN Servers via API
runs-on: ubuntu-latest
steps:
- name: 🍽️ Checkout the repo
uses: actions/checkout@v3
with:
path: master
fetch-depth: 0
- name: 🐍 Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: "3.8"
architecture: "x64"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests pandas
- name: 🚀 Run automation script
run: python master/.script/get-nordvpnservers.py
- name: Check if there are changes to commit
id: check_diff
run: |
cd master
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
cd ..
- name: Commit files
if: steps.check_diff.outputs.changed == 'true'
run: |
cd master
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add *
git commit -m "Adding new nord vpn server daily feed" -a
- name: Push changes
uses: ad-m/github-push-action@master
if: steps.check_diff.outputs.changed == 'true'
with:
directory: "master"
github_token: ${{ secrets.GITHUB_TOKEN }}