diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index b92c1a4..1a3b8c9 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -171,6 +171,13 @@ jobs: SENTRY_ORG: libnovel SENTRY_PROJECT: ui + - name: Upload injected build (for docker-ui) + uses: actions/upload-artifact@v3 + with: + name: ui-build-injected + path: build + retention-days: 1 + - name: Create GlitchTip release run: sentry-cli releases new ${{ steps.ver.outputs.version }} env: @@ -226,6 +233,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Download injected build (debug IDs already embedded) + uses: actions/download-artifact@v3 + with: + name: ui-build-injected + path: ui/build + - uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub @@ -255,6 +268,7 @@ jobs: BUILD_VERSION=${{ steps.meta.outputs.version }} BUILD_COMMIT=${{ gitea.sha }} BUILD_TIME=${{ gitea.event.head_commit.timestamp }} + PREBUILT=1 cache-from: type=registry,ref=${{ secrets.DOCKER_USER }}/libnovel-ui:latest cache-to: type=inline diff --git a/ui/Dockerfile b/ui/Dockerfile index 36e29a8..8b68e67 100644 --- a/ui/Dockerfile +++ b/ui/Dockerfile @@ -21,7 +21,11 @@ ENV PUBLIC_BUILD_VERSION=$BUILD_VERSION ENV PUBLIC_BUILD_COMMIT=$BUILD_COMMIT ENV PUBLIC_BUILD_TIME=$BUILD_TIME -RUN npm run build +# PREBUILT=1 skips npm run build — used in CI when the build/ directory has +# already been compiled (and debug IDs injected) by a prior job. The caller +# must copy the pre-built build/ into the Docker context before building. +ARG PREBUILT=0 +RUN [ "$PREBUILT" = "1" ] || npm run build # ── Runtime image ────────────────────────────────────────────────────────────── # adapter-node bundles most server-side code, but packages with dynamic