Spring #2950
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Spring | |
| on: | |
| push: | |
| branches: ['main'] | |
| paths: | |
| - '**/spring.*' | |
| - 'edge/assets/*.json' | |
| schedule: | |
| - cron: '0 */2 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: 'recursive' | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| architecture: x64 | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('edge/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f edge/requirements.txt ]; then | |
| pip install -r edge/requirements.txt | |
| else | |
| echo "requirements.txt not found, skipping dependency installation" | |
| fi | |
| - name: Run python | |
| run: | | |
| python edge/spring.py >> log.txt 2>&1 || (cat log.txt && exit 1) | |
| - name: Commit and push if changed | |
| run: | | |
| git config --local user.name "Diana-Cl" | |
| git config --local user.email "[email protected]" | |
| git add *.json | |
| git diff --quiet && git diff --staged --quiet || ( | |
| git commit -m "Automated config refresh completed at $(TZ='Asia/Tehran' date '+%H:%M:%S')" -m "Wireguard private key, addresses, reserved, and all IPs have been renewed" | |
| git -c committer.name="NiREvil" -c committer.email="[email protected]" \ | |
| commit --amend --no-edit | |
| ) | |
| git push | |