This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
Cache #2485
This file contains 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
# Workflow to cache all assets from IPFS on Cloudflare edge nodes. | |
# This will speed up the loading of the gateway and reduce the load on the IPFS nodes. | |
# | |
# Job also pushes metrics to Prometheus Pushgateway. | |
# s | |
# This workflow is scheduled to run 4 hours. | |
name: "Cache" | |
on: | |
schedule: | |
- cron: "0 */4 * * *" # every 4 hours | |
workflow_dispatch: | |
push: | |
paths: | |
- ".github/workflows/cache.yml" | |
- "cache.py" | |
- "cid_db.json" | |
jobs: | |
cache: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
pip install requests tqdm | |
- name: Cache | |
continue-on-error: true | |
run: | | |
python cache.py | |
- name: Push metrics | |
continue-on-error: true | |
run: | | |
cat metrics.txt | curl -H "Authorization: Basic ${{ secrets.PUSHGATEWAY_AUTH }}" --data-binary @- https://prometheus-push.frsqr.xyz/metrics/job/launcher_meta/instance/gh_actions |