Skip to content

ci(sentry): wire build-time vars into image build#168

Merged
NIXKnight merged 1 commit into
devfrom
NIXKnight/add-sentry
Jul 1, 2026
Merged

ci(sentry): wire build-time vars into image build#168
NIXKnight merged 1 commit into
devfrom
NIXKnight/add-sentry

Conversation

@NIXKnight

@NIXKnight NIXKnight commented Jul 1, 2026

Copy link
Copy Markdown
Member

What

Closes the delivery-pipeline gap left by #165 (Sentry SDK integration): supplies the four Sentry build-time variables to next build so the released frontend image is Sentry-instrumented.

Changes

Dockerfile

  • NEXT_PUBLIC_SENTRY_DSN, SENTRY_ORG, SENTRY_PROJECT → builder-stage ARG/ENV, so next build inlines the DSN and withSentryConfig uploads source maps.
  • SENTRY_AUTH_TOKEN → BuildKit secret mount (id=sentry_auth, required=false); never an ARG/ENV, never in an image layer, docker history, or the runtime image.
  • Added # syntax=docker/dockerfile:1 for secret-mount support.

.github/workflows/build-and-push-container-image.yml

  • Three public vars passed via build-args from repo secrets.
  • SENTRY_AUTH_TOKEN passed via docker/build-push-action secrets: (sentry_auth).

Required Actions secrets

NEXT_PUBLIC_SENTRY_DSN, SENTRY_ORG, SENTRY_PROJECT, SENTRY_AUTH_TOKEN. Without the token the build still succeeds (source-map upload skipped).

Notes

  • All four vars are build-time only; none read at runtime.

- Add NEXT_PUBLIC_SENTRY_DSN, SENTRY_ORG, SENTRY_PROJECT as builder-stage ARG/ENV so next build inlines the DSN and withSentryConfig uploads source maps
- Consume SENTRY_AUTH_TOKEN via a BuildKit secret (id: sentry_auth, required=false); the token never lands in an image layer, build arg, or the runtime image
- Add # syntax=docker/dockerfile:1 for secret mount support
- Pass the three public vars via build-args and the token via the build-push-action secrets: input in the release workflow
@NIXKnight NIXKnight merged commit d47eaf1 into dev Jul 1, 2026
1 check passed
@NIXKnight NIXKnight deleted the NIXKnight/add-sentry branch July 1, 2026 08:39
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.

2 participants