refresh-cache #317
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: refresh-cache | |
| # Combined list + snapshot cache refresh. | |
| # Replaces the former `refresh-lists` and `snapshot-refresh` workflows: a single | |
| # run pulls vault list metadata and full snapshots in one DB pass and writes both | |
| # Redis caches. | |
| on: | |
| schedule: | |
| - cron: '*/30 * * * *' | |
| workflow_dispatch: | |
| jobs: | |
| refresh: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: oven-sh/setup-bun@f4d14e03ff726c06358e5557344e1da148b56cf7 # v1 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Refresh list + snapshot cache | |
| env: | |
| POSTGRES_HOST: ${{ secrets.POSTGRES_HOST }} | |
| POSTGRES_DATABASE: ${{ secrets.POSTGRES_DATABASE }} | |
| POSTGRES_USER: ${{ secrets.POSTGRES_USER }} | |
| POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | |
| POSTGRES_PORT: ${{ secrets.POSTGRES_PORT }} | |
| POSTGRES_SSL: ${{ secrets.POSTGRES_SSL }} | |
| POSTGRES_POOL_MAX: ${{ vars.POSTGRES_POOL_MAX }} | |
| REST_CACHE_REDIS_URL: ${{ secrets.REST_CACHE_REDIS_URL }} | |
| run: bun packages/web/app/api/rest/refresh-vaults.ts | |
| - name: Report success to Uptime Kuma | |
| if: success() | |
| continue-on-error: true | |
| run: curl -fsS -m 10 -o /dev/null "${{ secrets.UPTIME_KUMA_PUSH_URL_REFRESH_VAULTS }}?status=up&msg=OK" | |
| - name: Report failure to Uptime Kuma | |
| if: failure() | |
| continue-on-error: true | |
| run: curl -fsS -m 10 -o /dev/null "${{ secrets.UPTIME_KUMA_PUSH_URL_REFRESH_VAULTS }}?status=down&msg=Run+failed" |