Skip to content

Daily Run

Daily Run #15

Workflow file for this run

name: Daily Run
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 2 * * *' # Runs at 2 AM every day
jobs:
daily-run:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO_VERSION: '1.24'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Set timestamp
run: echo "TIMESTAMP=$(date -u +"%H:%M %d-%m-%Y")" >> $GITHUB_ENV
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ env.GO_VERSION }}-
- name: Initialize Go module
run: |
if [ ! -f go.mod ]; then
go mod init cf-tools
go mod tidy
fi
- name: Commit go.mod & go.sum
if: ${{ success() }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add go.mod go.sum
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "Update dependencies - ${{ env.TIMESTAMP }}"
git push
fi
- name: Wait for 2 seconds
run: sleep 2
- name: Add dependencies
if: ${{ success() }}
run: |
go get github.com/flynn/noise
go get golang.org/x/crypto/blake2s
go get golang.org/x/crypto/curve25519
- name: Wait for 2 seconds
run: sleep 2
- name: Build the application
if: ${{ success() }}
run: go build -o cf-tools main.go
- name: Wait for 2 seconds
run: sleep 2
- name: Run Fetch and Convert
if: ${{ success() }}
run: ./cf-tools -f
- name: Commit output from ./cf-tools -f
uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "Update all_cf_v4_24.txt - ${{ env.TIMESTAMP }}"
file_pattern: all_cf_v4_24.txt
- name: Wait for 5 seconds
run: sleep 5
- name: Run CDN Checker
if: ${{ success() }}
run: ./cf-tools -c
- name: Commit output from ./cf-tools -c
uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "Update all_cdn_ipv4.txt - ${{ env.TIMESTAMP }}"
file_pattern: all_cdn_ipv4.txt
- name: Wait for 5 seconds
run: sleep 5
- name: Run WARP Checker
if: ${{ success() }}
run: ./cf-tools -w
- name: Commit output from ./cf-tools -w
uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "Update all_warp_ipv4.txt - ${{ env.TIMESTAMP }}"
file_pattern: all_warp_ipv4.txt