Cron Pins #54578
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
name: Cron Pins | |
on: | |
schedule: | |
- cron: '*/60 * * * *' | |
workflow_dispatch: | |
jobs: | |
update: | |
name: Update pin statuses and size | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
env: ['staging', 'production'] | |
include: | |
- env: production | |
pickup_url: https://pickup.dag.haus | |
- env: staging | |
pickup_url: https://staging.pickup.dag.haus | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Checkout latest cron release tag | |
run: | | |
LATEST_TAG=$(git describe --tags --abbrev=0 --match='cron-*') | |
git checkout $LATEST_TAG | |
- name: Setup node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
uses: bahmutov/npm-install@v1 | |
- name: Run job | |
env: | |
DEBUG: '*' | |
ENV: ${{ matrix.env }} | |
PROD_PG_REST_JWT: ${{ secrets.PROD_PG_REST_JWT }} | |
STAGING_PG_REST_JWT: ${{ secrets.STAGING_PG_REST_JWT }} | |
PROD_PG_REST_URL: ${{ secrets.PROD_PG_REST_URL }} | |
STAGING_PG_REST_URL: ${{ secrets.STAGING_PG_REST_URL }} | |
CLUSTER_API_URL: ${{ matrix.pickup_url }} | |
CLUSTER_BASIC_AUTH_TOKEN: ${{ secrets.CLUSTER_BASIC_AUTH_TOKEN }} | |
run: npm run start:pins -w packages/cron | |
- name: Heartbeat | |
if: ${{ success() }} | |
run: ./packages/tools/scripts/cli.js heartbeat --token ${{ secrets.OPSGENIE_KEY }} --name cron-web3storage-pins-${{matrix.env}} |