Skip to content

chore: CI/CD improvements — frontend build check, health check, rollback#241

Merged
saggacce merged 2 commits into
mainfrom
chore/ci-cd-improvements
May 31, 2026
Merged

chore: CI/CD improvements — frontend build check, health check, rollback#241
saggacce merged 2 commits into
mainfrom
chore/ci-cd-improvements

Conversation

@saggacce

Copy link
Copy Markdown
Owner

Problemas que resuelve

  1. Frontend no se reconstruía en producción — el build fallaba silenciosamente porque el CI usaba tsc --noEmit (root tsconfig) que no detectaba los mismos errores que tsc -b en apps/web
  2. Sin health check post-deploy — un deploy roto se marcaba como ✅
  3. Sin rollback — si algo fallaba, la app se quedaba en estado roto

Cambios en el pipeline

CI (pull_request + push a main):

  • Añadido paso «Build frontend» que ejecuta npm run build en apps/web — misma compilación que producción
  • Ahora los errores de build bloquean el merge antes de llegar al servidor

Deploy (push a main tras CI):

  • Guarda el commit actual antes de actualizar
  • Si el build falla → rollback al commit anterior inmediatamente
  • Health check: 6 reintentos × 5s = 30s para que el servidor arranque
  • Si el health check falla → rollback completo (git reset + rebuild + restart)
  • El deploy solo marca ✅ si el servidor responde correctamente

i18n: Añadida clave nav.invitations en ES y EN — causaba el error de build silencioso

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa21df5aca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml
if ! npm run build; then
echo "✗ Frontend build failed — rolling back to $PREVIOUS_COMMIT"
cd /var/opt/riftline/app
git reset --hard "$PREVIOUS_COMMIT"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore previous dist on frontend build rollback

When npm run build reaches the Vite phase and then fails, Vite prepares the output directory before writing (emptyOutDir defaults to true for an in-root dist), and apps/web/dist is gitignored while the running API serves that directory from disk in production. In that failure mode this rollback only resets tracked files, so the old PM2 process can continue serving an emptied or partially rewritten frontend until someone manually rebuilds the previous commit; rebuild the previous frontend (and restore deps if needed) before exiting this rollback path.

Useful? React with 👍 / 👎.

@saggacce saggacce merged commit 1ffa57c into main May 31, 2026
3 checks passed
@saggacce saggacce deleted the chore/ci-cd-improvements branch May 31, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant