ci: build and publish images with NEXT_PUBLIC_LOCALE_PREFIX=always#575
Open
HardAndHeavy wants to merge 1 commit into
Open
ci: build and publish images with NEXT_PUBLIC_LOCALE_PREFIX=always#575HardAndHeavy wants to merge 1 commit into
HardAndHeavy wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends the existing GitHub Actions workflow to automatically build and publish Docker images with the
NEXT_PUBLIC_LOCALE_PREFIXenvironment variable set toalways. As documented in the README, this configuration is required for users who want to serve the webmail at a subpath to avoidnext-intlrewrite loops. This provides pre-built images (-alwayssuffix) for these users, removing the need for them to build their own custom images.Important: The
NEXT_PUBLIC_BASE_PATHis intentionally NOT set in these builds. Each user may have a different subpath (e.g.,/webmail,/mail,/apps/email), and sinceNEXT_PUBLIC_*variables are inlined at build time, hardcoding a specific base path would make the image unusable for most users. Setting onlyNEXT_PUBLIC_LOCALE_PREFIX=alwaysis the correct approach.Changes
build-alwaysjob that builds images withbuild-args: NEXT_PUBLIC_LOCALE_PREFIX=alwaysonly.merge-alwaysjob that creates a separate multi-arch manifest list with-alwayssuffixed tags (e.g.,ghcr.io/bulwarkmail/webmail:1.7.6-alwaysandlatest-always).Related Issues
Closes the need for users to manually rebuild images when deploying to a subpath. Related to documentation in the README.
Closes #
Type of Change
Checklist
npm run typecheck && npm run lintand there are no errors (N/A — CI change only)npm run build) (N/A — CI change only)-alwaysimages if this is merged.locales/) if my changes affect user-facing text (N/A)Screenshots / Demo
N/A — CI/CD pipeline changes only.
Notes for Reviewers
build-alwaysandmerge-alwaysjobs are copies of thebuildandmergejobs, withbuild-args: NEXT_PUBLIC_LOCALE_PREFIX=alwaysadded.flavor: suffix=-always,onlatest=trueto ensure that thelatesttag also gets the-alwayssuffix, preventing it from overwriting the standardlatestimage.release: publishedandworkflow_dispatchevents. If triggered manually from a non-release branch, thelatest-alwaystag could be overwritten with a non-release build. This is a pre-existing issue in the original workflow that this PR does not attempt to fix, as it would require changing the main workflow's behavior and be out of scope for this change. The-alwaysimages are primarily intended for release builds.NEXT_PUBLIC_BASE_PATHis intentionally omitted — users should set it according to their own subpath deployment needs, not via a pre-built image.