Update GitHub Actions deploy workflow for Astro build
Parent PRD: #34
User Story: As Naren, I want GitHub Pages to auto-deploy the Astro-built site on every push to main.
Type: Feature Slice
Complexity: S
Blocked by
Blocks
- All issues that need end-to-end deploy verification depend on this being correct.
Context
Current .github/workflows/deploy.yml uploads the repo root (path: '.') directly to Pages - no build step. After Astro migration, we need to run npm install && npm run build first, then deploy the dist/ output folder. This is a small but critical change - getting it wrong means the site deploys broken HTML instead of built Astro output.
This issue can be created and merged ahead of the Astro scaffold (it will just fail until the Astro package.json exists, which is fine on a feature branch).
Acceptance Criteria
Technical Notes
- Modify:
.github/workflows/deploy.yml
- Insert between
actions/checkout@v4 and actions/configure-pages@v4:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run build
env:
PUBLIC_POSTHOG_KEY: ${{ secrets.PUBLIC_POSTHOG_KEY }}
- Change upload path:
path: './dist'
- Add to GitHub repo secrets:
PUBLIC_POSTHOG_KEY (value from PostHog project settings)
Test Plan
Risks
npm ci requires package-lock.json to exist - must be committed alongside package.json when Astro is scaffolded
Update GitHub Actions deploy workflow for Astro build
Parent PRD: #34
User Story: As Naren, I want GitHub Pages to auto-deploy the Astro-built site on every push to main.
Type: Feature Slice
Complexity: S
Blocked by
Blocks
Context
Current
.github/workflows/deploy.ymluploads the repo root (path: '.') directly to Pages - no build step. After Astro migration, we need to runnpm install && npm run buildfirst, then deploy thedist/output folder. This is a small but critical change - getting it wrong means the site deploys broken HTML instead of built Astro output.This issue can be created and merged ahead of the Astro scaffold (it will just fail until the Astro
package.jsonexists, which is fine on a feature branch).Acceptance Criteria
deploy.ymlhas Node.js 20 setup step usingactions/setup-node@v4npm ciruns before build (uses lockfile for reproducibility)npm run buildruns and outputs todist/actions/upload-pages-artifactpath changed from'.'to'./dist'mainonlypages: write,id-token: write)PUBLIC_POSTHOG_KEYadded as GitHub Actions secret (documented in README, not hardcoded)Technical Notes
.github/workflows/deploy.ymlactions/checkout@v4andactions/configure-pages@v4:path: './dist'PUBLIC_POSTHOG_KEY(value from PostHog project settings)Test Plan
Risks
npm cirequirespackage-lock.jsonto exist - must be committed alongsidepackage.jsonwhen Astro is scaffolded