Skip to content

Commit 08d42d6

Browse files
authored
Pass Sentry auth token during FE build (#4259)
1 parent abf5430 commit 08d42d6

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ jobs:
306306
307307
conference_code=$(aws ssm get-parameter --output text --query Parameter.Value --with-decryption --name /pythonit/${{ env.TF_WORKSPACE }}/pycon-frontend/conference-code)
308308
echo "CONFERENCE_CODE=$conference_code" >> "$GITHUB_OUTPUT"
309+
310+
sentry_auth_token=$(aws ssm get-parameter --output text --query Parameter.Value --with-decryption --name /pythonit/${{ env.TF_WORKSPACE }}/common/sentry-auth-token)
311+
echo "::add-mask::$sentry_auth_token"
312+
echo "SENTRY_AUTH_TOKEN=$sentry_auth_token" >> "$GITHUB_OUTPUT"
309313
- name: Build and push
310314
if: ${{ steps.image.outputs.image_exists == 0 }}
311315
uses: docker/build-push-action@v6
@@ -326,6 +330,8 @@ jobs:
326330
CMS_HOSTNAME=${{ steps.vars.outputs.cms_hostname }}
327331
CONFERENCE_CODE=${{ steps.vars.outputs.conference_code }}
328332
GIT_HASH=${{ steps.git.outputs.githash }}
333+
secrets: |
334+
"sentry_auth_token=${{ steps.vars.outputs.sentry_auth_token }}"
329335
330336
deploy-fe:
331337
runs-on: ubuntu-24.04

frontend/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ WORKDIR /app
2424
COPY --from=deps /app/node_modules ./node_modules
2525
COPY . .
2626

27-
RUN corepack enable pnpm && pnpm run build
27+
RUN corepack enable pnpm
28+
RUN --mount=type=secret,id=sentry_auth_token,env=SENTRY_AUTH_TOKEN \
29+
pnpm run build
2830

2931
FROM base AS runner
3032
WORKDIR /app

frontend/next.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,6 @@ const nextConfig = {
130130

131131
module.exports = withSentryConfig(nextConfig, {
132132
authToken: SENTRY_AUTH_TOKEN,
133+
org: "python-italia",
134+
project: "pycon-frontend",
133135
});

0 commit comments

Comments
 (0)