SummerTime #746
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: SummerTime | |
| on: | |
| push: | |
| branches: ['main'] | |
| paths: | |
| - '**/summer.*' | |
| - 'sub/*.txt' | |
| schedule: | |
| - cron: '0 */8 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-configs: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| dummy: ['single'] | |
| steps: | |
| - 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' | |
| cache: pip | |
| architecture: x64 | |
| - name: Cache Python packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r edge/requirements.txt || exit 1 | |
| - name: Run summer.py to fetch new wireguard configratiions | |
| run: | | |
| python edge/summer.py | |
| - name: Commit and push if changes any | |
| run: | | |
| git config --local user.name "Workflow Wizard" | |
| git config --local user.email "[email protected]" | |
| git add sub/*.txt | |
| if ! git diff --quiet || ! git diff --staged --quiet; then | |
| git commit -m "WireGuard configs harvest at: $(TZ='Asia/Tehran' date '+%H:%M:%S')" \ | |
| -m "The new wireguard configurations were obtained from Telegram channels --Diwire and --FreeWireGuard, And subsequently added to the list corresponding to their respective clients." \ | |
| --author="Diana-Cl <[email protected]>" | |
| git push || exit 1 | |
| else | |
| echo "No changes detected. Skipping commit and push." | |
| fi |