Skip to content

Commit 3cbcc6f

Browse files
add build config
1 parent e8b8c8c commit 3cbcc6f

7 files changed

Lines changed: 51 additions & 49 deletions

File tree

.github/workflows/build-authui.yml

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111

1212
jobs:
1313
build-and-push:
14+
environment: ${{ github.event_name == 'release' && 'production' || 'staging' }}
1415
permissions:
1516
contents: read
1617
packages: write
@@ -20,50 +21,52 @@ jobs:
2021
runs-on: ubuntu-latest
2122

2223
steps:
23-
- name: Checkout repository
24-
uses: actions/checkout@v4
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
2526

26-
- name: Log in to GitHub Container Registry
27-
uses: docker/login-action@v3.4.0
28-
with:
29-
registry: ghcr.io
30-
username: ${{ github.actor }}
31-
password: ${{ secrets.GITHUB_TOKEN }}
27+
- name: Log in to GitHub Container Registry
28+
uses: docker/login-action@v3.4.0
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
3233

33-
- name: Extract metadata
34-
id: meta
35-
uses: docker/metadata-action@v5
36-
with:
37-
images: ghcr.io/datum-cloud/auth-ui
38-
tags: |
39-
type=ref,event=pr,suffix=-{{commit_date 'YYYYMMDD-HHmmss'}},prefix=v0.0.0-
40-
type=ref,event=pr,prefix=v0.0.0-
41-
type=ref,event=branch,suffix=-{{commit_date 'YYYYMMDD-HHmmss'}},prefix=v0.0.0-
42-
type=ref,event=branch,prefix=v0.0.0-
43-
type=semver,pattern=v{{version}}
44-
type=semver,pattern=v{{major}}.{{minor}}
45-
type=semver,pattern=v{{major}}
46-
type=sha,prefix=v0.0.0-
34+
- name: Extract metadata
35+
id: meta
36+
uses: docker/metadata-action@v5
37+
with:
38+
images: ghcr.io/datum-cloud/auth-ui
39+
tags: |
40+
type=ref,event=pr,suffix=-{{commit_date 'YYYYMMDD-HHmmss'}},prefix=v0.0.0-
41+
type=ref,event=pr,prefix=v0.0.0-
42+
type=ref,event=branch,suffix=-{{commit_date 'YYYYMMDD-HHmmss'}},prefix=v0.0.0-
43+
type=ref,event=branch,prefix=v0.0.0-
44+
type=semver,pattern=v{{version}}
45+
type=semver,pattern=v{{major}}.{{minor}}
46+
type=semver,pattern=v{{major}}
47+
type=sha,prefix=v0.0.0-
4748
48-
- name: Build Auth UI Docker image
49-
run: make login_standalone_build
49+
- name: Build Auth UI Docker image
50+
env:
51+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
52+
run: make login_standalone_build
53+
54+
- name: Tag and push image to GHCR
55+
env:
56+
TAGS: ${{ steps.meta.outputs.tags }}
57+
LABELS: ${{ steps.meta.outputs.labels }}
58+
IMAGE_VERSION: ${{ steps.meta.outputs.version }}
59+
run: |
60+
IMAGE="zitadel-login:${IMAGE_VERSION}"
61+
echo "Pushing $IMAGE with tags: $TAGS"
62+
# Convert tags (newline or comma separated) into space-separated list
63+
for TAG in $(echo "$TAGS" | tr '\n' ' '); do
64+
echo "Tagging $IMAGE as $TAG"
65+
docker tag "$IMAGE" "$TAG"
66+
echo "Pushing $TAG"
67+
docker push "$TAG"
68+
done
5069
51-
- name: Tag and push image to GHCR
52-
env:
53-
TAGS: ${{ steps.meta.outputs.tags }}
54-
LABELS: ${{ steps.meta.outputs.labels }}
55-
IMAGE_VERSION: ${{ steps.meta.outputs.version }}
56-
run: |
57-
IMAGE="zitadel-login:${IMAGE_VERSION}"
58-
echo "Pushing $IMAGE with tags: $TAGS"
59-
# Convert tags (newline or comma separated) into space-separated list
60-
for TAG in $(echo "$TAGS" | tr '\n' ' '); do
61-
echo "Tagging $IMAGE as $TAG"
62-
docker tag "$IMAGE" "$TAG"
63-
echo "Pushing $TAG"
64-
docker push "$TAG"
65-
done
66-
6770
publish-kustomize-bundles:
6871
# Add explicit dependency so that the kustomize bundles only get published
6972
# if the container image has been built successfully. This helps prevent
@@ -80,4 +83,4 @@ jobs:
8083
bundle-path: config
8184
image-overlays: config/base
8285
image-name: ghcr.io/datum-cloud/auth-ui
83-
secrets: inherit
86+
secrets: inherit

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export GID := $(id -g)
1414
export LOGIN_TEST_ACCEPTANCE_BUILD_CONTEXT := $(LOGIN_DIR)apps/login-test-acceptance
1515

1616
export DOCKER_METADATA_OUTPUT_VERSION ?= local
17+
export SENTRY_AUTH_TOKEN ?=
1718
export LOGIN_TAG ?= zitadel-login:${DOCKER_METADATA_OUTPUT_VERSION}
1819
export LOGIN_TEST_UNIT_TAG := login-test-unit:${DOCKER_METADATA_OUTPUT_VERSION}
1920
export LOGIN_TEST_INTEGRATION_TAG := login-test-integration:${DOCKER_METADATA_OUTPUT_VERSION}

apps/login/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/dev/types/routes.d.ts";
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/login/next.config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ export default withSentryConfig(withNextIntl(nextConfig), {
100100
project: "auth-ui",
101101
sentryUrl: process.env.NEXT_PUBLIC_SENTRY_URL,
102102

103-
reactComponentAnnotation: {
104-
enabled: true,
105-
},
106-
107103
// Only print logs for uploading source maps in CI
108104
silent: !process.env.CI,
109105

@@ -121,5 +117,4 @@ export default withSentryConfig(withNextIntl(nextConfig), {
121117

122118

123119
authToken: process.env.SENTRY_AUTH_TOKEN,
124-
125120
});

apps/login/src/components/consent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function ConsentScreen({
5656
)}
5757
{scopes?.map((s) => {
5858
const translationKey = `device.scope.${s}`;
59-
const description = t(translationKey, null);
59+
const description = t(translationKey);
6060

6161
// Check if the key itself is returned and provide a fallback
6262
const resolvedDescription =

docker-bake.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ target "login-standalone" {
148148
contexts = {
149149
login-client = "target:login-client"
150150
}
151+
secret = ["id=sentry_auth_token,env=SENTRY_AUTH_TOKEN"]
151152
}
152153

153154
target "login-standalone-out" {

dockerfiles/login-standalone.Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ RUN cp -r ../out/json/* .
77
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
88
pnpm install --frozen-lockfile
99
RUN cp -r ../out/full/* .
10-
RUN pnpm exec turbo run build:login:standalone
10+
RUN --mount=type=secret,id=sentry_auth_token,required=false \
11+
if [ -s /run/secrets/sentry_auth_token ]; then export SENTRY_AUTH_TOKEN="$(cat /run/secrets/sentry_auth_token)"; fi; \
12+
pnpm exec turbo run build:login:standalone
1113

1214
FROM scratch AS login-standalone-out
1315
COPY --from=login-standalone-builder /build/docker/apps/login/.next/standalone /

0 commit comments

Comments
 (0)