Skip to content

docs: engineering README #9

docs: engineering README

docs: engineering README #9

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Lint
run: npm run lint
deploy-preview:
needs: test
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: constraint-theory-web
directory: .
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
deploy-production:
needs: test
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: constraint-theory-web
directory: .
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: main
- name: Verify deployment
run: |
curl -sSf https://constraint-theory.superinstance.ai/api/health | jq .
- name: Notify deployment
if: success()
run: |
curl -X POST ${{ secrets.SLACK_WEBHOOK }} \
-H 'Content-Type: application/json' \
-d '{"text": "Deployed constraint-theory-web to production"}'