Update proxy mirror #2485
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: Update proxy mirror | |
| on: | |
| schedule: | |
| - cron: "*/30 * * * *" | |
| workflow_dispatch: | |
| concurrency: | |
| group: proxy-sync | |
| cancel-in-progress: true | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install deps | |
| run: pip install -r requirements.txt | |
| # 🔑 RESTORE hashes cache BEFORE running sync | |
| - name: Restore hashes cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .cache | |
| key: proxy-hashes-${{ github.ref }} | |
| restore-keys: | | |
| proxy-hashes- | |
| - name: Run sync script | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| URLS_SECRET_KEY: ${{ secrets.URLS_SECRET_KEY }} | |
| run: | | |
| set -euo pipefail | |
| python src/sync.py | |
| # 💾 SAVE hashes cache AFTER successful run | |
| - name: Save hashes cache | |
| if: success() | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: .cache | |
| key: proxy-hashes-${{ github.ref }} | |
| - name: Summary | |
| if: always() | |
| run: | | |
| echo "### Proxy sync finished" >> $GITHUB_STEP_SUMMARY | |
| echo "- Time: $(date -u)" >> $GITHUB_STEP_SUMMARY |