Skip to content

Production Smoke

Production Smoke #385

name: Production Smoke
on:
workflow_dispatch:
inputs:
force_failure:
description: "Force a smoke failure to test failure notifications"
required: false
type: boolean
default: false
schedule:
- cron: "*/30 * * * *"
workflow_run:
workflows:
- Deploy Web to Cloudflare Pages
types:
- completed
jobs:
smoke:
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
env:
MOSHI_WEBHOOK_TOKEN: ${{ secrets.MOSHI_WEBHOOK_TOKEN }}
GROUND_CODES_SMOKE_FORCE_FAILURE: ${{ github.event.inputs.force_failure || 'false' }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "22"
package-manager-cache: false
- name: Run production smoke
run: node scripts/production-smoke.mjs
- name: Notify smoke failure
if: failure() && env.MOSHI_WEBHOOK_TOKEN != ''
run: |
curl -X POST https://api.getmoshi.app/api/webhook \
-H "Content-Type: application/json" \
-d "{\"token\":\"${MOSHI_WEBHOOK_TOKEN}\",\"title\":\"ground.codes smoke failed\",\"message\":\"Production smoke failed on ${GITHUB_REF_NAME}. Run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}\"}"