Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
DEPLOY_TARGET: github-pages
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -73,6 +75,10 @@ jobs:
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Generate standup digest
env:
GH_TOKEN: ${{ github.token }}
run: npm run standup:generate
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
- name: Upload artifact
Expand Down
131 changes: 131 additions & 0 deletions .github/workflows/vercel-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: Vercel preview

on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

permissions:
contents: read
issues: write
pull-requests: write

concurrency:
group: vercel-preview-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

jobs:
preview:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Decide whether preview deploy can run
id: preview-config
env:
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
BASE_REPO: ${{ github.repository }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: |
if [ -z "$VERCEL_TOKEN" ] || [ -z "$VERCEL_ORG_ID" ] || [ -z "$VERCEL_PROJECT_ID" ]; then
echo "enabled=false" >> "$GITHUB_OUTPUT"
echo "reason=Missing one or more Vercel secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID." >> "$GITHUB_OUTPUT"
elif [ "$HEAD_REPO" != "$BASE_REPO" ]; then
echo "enabled=false" >> "$GITHUB_OUTPUT"
echo "reason=Preview deploys are skipped for forked pull requests because repository secrets are unavailable." >> "$GITHUB_OUTPUT"
else
echo "enabled=true" >> "$GITHUB_OUTPUT"
fi

- name: Setup Node
if: steps.preview-config.outputs.enabled == 'true'
uses: actions/setup-node@v4
with:
node-version: '24'
cache: npm

- name: Install dependencies
if: steps.preview-config.outputs.enabled == 'true'
run: npm ci

- name: Install Vercel CLI
if: steps.preview-config.outputs.enabled == 'true'
run: npm install --global vercel@latest

- name: Pull Vercel settings
if: steps.preview-config.outputs.enabled == 'true'
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: vercel pull --yes --environment=preview --token="$VERCEL_TOKEN"

- name: Generate standup digest
if: steps.preview-config.outputs.enabled == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: npm run standup:generate

- name: Build preview output
if: steps.preview-config.outputs.enabled == 'true'
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: vercel build --token="$VERCEL_TOKEN"

- name: Deploy preview to Vercel
if: steps.preview-config.outputs.enabled == 'true'
id: deploy
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: |
url="$(vercel deploy --prebuilt --yes --token="$VERCEL_TOKEN" | tail -n 1)"
echo "url=$url" >> "$GITHUB_OUTPUT"
echo "Preview deployment: $url" >> "$GITHUB_STEP_SUMMARY"

- name: Post preview URL to pull request
if: steps.preview-config.outputs.enabled == 'true' && github.event_name == 'pull_request'
uses: actions/github-script@v7
env:
PREVIEW_URL: ${{ steps.deploy.outputs.url }}
with:
script: |
const marker = '<!-- pulse-vercel-preview -->'
const body = `${marker}\nVercel preview is ready: ${process.env.PREVIEW_URL}`

const { owner, repo } = context.repo
const issue_number = context.payload.pull_request.number
const comments = await github.paginate(github.rest.issues.listComments, {
owner,
repo,
issue_number,
per_page: 100,
})

const existing = comments.find((comment) =>
comment.user?.type === 'Bot' && comment.body?.includes(marker)
)

if (existing) {
await github.rest.issues.updateComment({
owner,
repo,
comment_id: existing.id,
body,
})
} else {
await github.rest.issues.createComment({
owner,
repo,
issue_number,
body,
})
}

- name: Note skipped preview deploy
if: steps.preview-config.outputs.enabled != 'true'
run: |
echo "Vercel preview skipped." >> "$GITHUB_STEP_SUMMARY"
echo "${{ steps.preview-config.outputs.reason }}" >> "$GITHUB_STEP_SUMMARY"
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ yarn-error.log*
# env files (can opt-in for committing if needed)
.env*

# data
/data/*.json
!/data/team.json.example
# generated standup data
/public/data/standup-report.json

# vercel
.vercel
Expand Down
63 changes: 48 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,59 @@
# PolicyEngine pulse

Team meeting coordination hub with standup timers and weekly surveys.
`pulse` is now a static, theme-first standup review tool.

## Setup
Instead of randomizing speakers and collecting survey data, the new flow is:

### Database setup
1. Pull the last day of in-scope GitHub activity for the team with `gh`
2. Roll the resulting work into a small set of standup themes
3. Review those themes in the app before going person-by-person

1. Run `npm run setup` to get the SQL schema
2. Go to your Supabase SQL editor
3. Paste and run the SQL to create tables
## Daily workflow

### Local development
Generate the daily digest:

1. Copy `.env.example` to `.env.local`
2. Fill in your Supabase credentials
3. Run `npm install`
4. Run `npm run dev`
```bash
npm run standup:generate
```

That writes a local build artifact at `public/data/standup-report.json`, which the app reads directly.

Then run the app locally:

```bash
npm install
npm run dev
```

## Team config

The generator reads [`public/data/team-members.json`](/Users/maxghenis/PolicyEngine/pulse/public/data/team-members.json).

That file controls:

- which GitHub users are included
- which orgs or repos count as “in scope”
- repo-level fallback topics
- keyword rules used to cluster work into shared standup topics

## Why this shape

The efficient path for PE standup is not “one random person at a time.” It is:

- theme-first review so related work gets discussed together without exploding into dozens of one-off sections
- raw per-person activity kept available as a secondary check
- static JSON output so you can regenerate with a script, inspect it with Codex, and ship it to GitHub Pages without a backend

## Deployment

The app automatically deploys to GitHub Pages when you push to main. Make sure you've:
1. Enabled GitHub Pages in repository settings (source: GitHub Actions)
2. Set up the database tables in Supabase
The app is still a static Next.js export deployed via GitHub Pages from `main`.

The Pages workflow now regenerates the standup digest during build, so the deployed site does not depend on a committed daily JSON snapshot.

There is also a pull-request preview workflow for Vercel in [`.github/workflows/vercel-preview.yml`](/Users/maxghenis/PolicyEngine/pulse/.github/workflows/vercel-preview.yml). To enable it, add these repository secrets:

- `VERCEL_TOKEN`
- `VERCEL_ORG_ID`
- `VERCEL_PROJECT_ID`

The app will be available at `https://[your-username].github.io/pulse/`
The workflow builds in GitHub Actions, runs `npm run standup:generate` there, and deploys the prebuilt output to a Vercel preview URL. It skips automatically for forked pull requests or when the Vercel secrets are missing.
98 changes: 0 additions & 98 deletions SUPABASE_SETUP.md

This file was deleted.

Loading
Loading