Skip to content

Update Domains

Update Domains #301

Workflow file for this run

name: Update Domains
on:
schedule:
- cron: '0 0 */2 * *'
workflow_dispatch:
jobs:
update_domains:
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup WireGuard
run: |
sudo apt-get update
sudo apt-get install -y wireguard resolvconf
echo "${{ secrets.WIREGUARD_CONFIG }}" > wg0.conf
sudo mv wg0.conf /etc/wireguard/wg0.conf
sudo wg-quick up wg0
shell: bash
continue-on-error: false
- name: Download and Split
run: |
echo "Starting download..."
wget --no-check-certificate --continue --timeout=60 --tries=1 --dns-timeout=10 --connect-timeout=30 --read-timeout=60 --progress=dot:mega --output-document=domains "${{ secrets.SOURCE_URL }}"
if [ ! -f domains ] || [ ! -s domains ]; then
echo "Download failed or file is empty"
exit 1
fi
echo "File size: $(du -h domains)"
mkdir -p domain
split -l 2500000 -d domains domain/chunk
shell: bash
continue-on-error: false
- name: KillGuard
run: |
sudo wg-quick down wg0
shell: bash
continue-on-error: false
- name: Git stuff
run: |
git config user.name "${{ secrets.GHUB_USERNAME }}"
git config user.email "${{ secrets.GHUB_EMAIL }}"
- name: Commit and Push
env:
GHUB_TOKEN: ${{ secrets.GHUB_TOKEN }}
run: |
git add domain/
git commit -m "[Auto] Update Domains"
git push -u origin main
shell: bash
continue-on-error: false
- name: Success maybe
run: echo "Script completed successfully."