Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
fix: commit sha display
Browse files- .github/workflows/deploy-prod.yml +4 -0
- Dockerfile +2 -3
- src/routes/settings/(nav)/+page.svelte +7 -5
- svelte.config.js +1 -1
.github/workflows/deploy-prod.yml
CHANGED
@@ -29,6 +29,9 @@ jobs:
|
|
29 |
- name: Set up Docker Buildx
|
30 |
uses: docker/setup-buildx-action@v3
|
31 |
|
|
|
|
|
|
|
32 |
- name: Build and Publish HuggingChat image
|
33 |
uses: docker/build-push-action@v5
|
34 |
with:
|
@@ -45,6 +48,7 @@ jobs:
|
|
45 |
INCLUDE_DB=false
|
46 |
APP_BASE=/chat
|
47 |
PUBLIC_APP_COLOR=yellow
|
|
|
48 |
deploy:
|
49 |
name: Deploy on prod
|
50 |
runs-on: ubuntu-latest
|
|
|
29 |
- name: Set up Docker Buildx
|
30 |
uses: docker/setup-buildx-action@v3
|
31 |
|
32 |
+
- name: Inject slug/short variables
|
33 |
+
uses: rlespinasse/[email protected]
|
34 |
+
|
35 |
- name: Build and Publish HuggingChat image
|
36 |
uses: docker/build-push-action@v5
|
37 |
with:
|
|
|
48 |
INCLUDE_DB=false
|
49 |
APP_BASE=/chat
|
50 |
PUBLIC_APP_COLOR=yellow
|
51 |
+
PUBLIC_COMMIT_SHA=${{ env.GITHUB_SHA_SHORT }}
|
52 |
deploy:
|
53 |
name: Deploy on prod
|
54 |
runs-on: ubuntu-latest
|
Dockerfile
CHANGED
@@ -1,6 +1,4 @@
|
|
1 |
# syntax=docker/dockerfile:1
|
2 |
-
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
3 |
-
# you will also find guides on how best to write your Dockerfile
|
4 |
ARG INCLUDE_DB=false
|
5 |
|
6 |
FROM node:20-slim AS base
|
@@ -87,8 +85,9 @@ ENV INCLUDE_DB=${INCLUDE_DB}
|
|
87 |
ARG APP_BASE=
|
88 |
# tailwind requires the primary theme to be known at build time so it must be passed as a build arg
|
89 |
ARG PUBLIC_APP_COLOR=blue
|
|
|
|
|
90 |
ENV BODY_SIZE_LIMIT=15728640
|
91 |
-
|
92 |
#import the build & dependencies
|
93 |
COPY --from=builder --chown=1000 /app/build /app/build
|
94 |
COPY --from=builder --chown=1000 /app/node_modules /app/node_modules
|
|
|
1 |
# syntax=docker/dockerfile:1
|
|
|
|
|
2 |
ARG INCLUDE_DB=false
|
3 |
|
4 |
FROM node:20-slim AS base
|
|
|
85 |
ARG APP_BASE=
|
86 |
# tailwind requires the primary theme to be known at build time so it must be passed as a build arg
|
87 |
ARG PUBLIC_APP_COLOR=blue
|
88 |
+
ARG PUBLIC_COMMIT_SHA=
|
89 |
+
ENV PUBLIC_COMMIT_SHA=${PUBLIC_COMMIT_SHA}
|
90 |
ENV BODY_SIZE_LIMIT=15728640
|
|
|
91 |
#import the build & dependencies
|
92 |
COPY --from=builder --chown=1000 /app/build /app/build
|
93 |
COPY --from=builder --chown=1000 /app/node_modules /app/node_modules
|
src/routes/settings/(nav)/+page.svelte
CHANGED
@@ -19,11 +19,13 @@
|
|
19 |
<div class="flex w-full flex-col gap-5">
|
20 |
<div class="flex flex-col items-start justify-between text-xl font-semibold text-gray-800">
|
21 |
<h2>Application Settings</h2>
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
27 |
</div>
|
28 |
<div class="flex h-full max-w-2xl flex-col gap-2 max-sm:pt-0">
|
29 |
{#if envPublic.PUBLIC_APP_DATA_SHARING === "1"}
|
|
|
19 |
<div class="flex w-full flex-col gap-5">
|
20 |
<div class="flex flex-col items-start justify-between text-xl font-semibold text-gray-800">
|
21 |
<h2>Application Settings</h2>
|
22 |
+
{#if !!envPublic.PUBLIC_COMMIT_SHA}
|
23 |
+
<span class="text-sm font-light text-gray-500">
|
24 |
+
Latest deployment <span class="gap-2 font-mono"
|
25 |
+
>{envPublic.PUBLIC_COMMIT_SHA.slice(0, 7)}</span
|
26 |
+
>
|
27 |
+
</span>
|
28 |
+
{/if}
|
29 |
</div>
|
30 |
<div class="flex h-full max-w-2xl flex-col gap-2 max-sm:pt-0">
|
31 |
{#if envPublic.PUBLIC_APP_DATA_SHARING === "1"}
|
svelte.config.js
CHANGED
@@ -16,7 +16,7 @@ function getCurrentCommitSHA() {
|
|
16 |
}
|
17 |
|
18 |
process.env.PUBLIC_VERSION ??= process.env.npm_package_version;
|
19 |
-
process.env.PUBLIC_COMMIT_SHA
|
20 |
|
21 |
/** @type {import('@sveltejs/kit').Config} */
|
22 |
const config = {
|
|
|
16 |
}
|
17 |
|
18 |
process.env.PUBLIC_VERSION ??= process.env.npm_package_version;
|
19 |
+
process.env.PUBLIC_COMMIT_SHA ??= getCurrentCommitSHA();
|
20 |
|
21 |
/** @type {import('@sveltejs/kit').Config} */
|
22 |
const config = {
|