Spring #929
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.*' | |
| - '**/singbox-template.*' | |
| schedule: | |
| - cron: '0 13 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| strategy: | |
| matrix: | |
| python-version: ['3.13'] | |
| dummy: ['single'] | |
| 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: ${{ matrix.python-version }} | |
| architecture: x64 | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('edge/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-${{ matrix.python-version }}- | |
| - 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 Script | |
| run: python edge/spring.py | |
| - name: Commit and push if changed | |
| run: | | |
| git config --local user.name "Diana-Cl" | |
| git config --local user.email "135276904+Diana-Cl@users.noreply.github.com" | |
| # Add all generated JSON files to staging | |
| git add *.json | |
| # Check if there are any changes to commit | |
| if git diff --staged --quiet; then | |
| echo "No changes to commit." | |
| else | |
| echo "Changes detected. Committing and pushing..." | |
| git commit -m "Automated config refresh completed at: $(TZ='Asia/Tehran' date '+%H:%M:%S')" -m "Wireguard private keys, addresses, reserved codea, and all IPs have been renewed" | |
| git -c committer.name="NiREvil" -c committer.email="126243832+NiREvil@users.noreply.github.com" commit --amend --no-edit | |
| git push | |
| fi |