Cron Metrics #24450
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 Metrics | |
on: | |
schedule: | |
- cron: '*/20 * * * *' | |
workflow_dispatch: | |
jobs: | |
update: | |
name: Calculate metrics | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
env: ['staging', 'production'] | |
timeout-minutes: 20 | |
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 | |
- uses: pnpm/action-setup@v2.0.1 | |
with: | |
version: 6.32.x | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- run: pnpm install | |
- name: Run job | |
env: | |
DEBUG: '*' | |
ENV: ${{ matrix.env }} | |
STAGING_DATABASE_CONNECTION: ${{ secrets.STAGING_DATABASE_CONNECTION }} | |
STAGING_RO_DATABASE_CONNECTION: ${{ secrets.STAGING_DATABASE_CONNECTION }} # no replica for staging | |
PROD_DATABASE_CONNECTION: ${{ secrets.PROD_DATABASE_CONNECTION }} | |
PROD_RO_DATABASE_CONNECTION: ${{ secrets.PROD_RO_DATABASE_CONNECTION }} | |
run: pnpm --filter cron start:metrics |