From: Dessalines Date: Mon, 26 Apr 2021 13:57:41 +0000 (-0400) Subject: Add UI version to UI via docker. Fixes #263 (#278) X-Git-Url: http://these/git/%22https:/image.com/%7B%7D/%7BpictshareAvatarThumbnail%28?a=commitdiff_plain;h=7f348fd0743259882f4e8dd013c1386f38d4e1fa;p=lemmy-ui.git Add UI version to UI via docker. Fixes #263 (#278) * Add UI version to UI via docker. Fixes #263 * Adding git fetch tags to CI. --- diff --git a/.drone.yml b/.drone.yml index 7c4cea8..bfb6ab7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,6 +14,7 @@ steps: - apk add git - git submodule init - git submodule update --recursive --remote + - git fetch --tags - name: yarn image: node:14-alpine @@ -110,6 +111,7 @@ steps: - apk add git - git submodule init - git submodule update --recursive --remote + - git fetch --tags when: ref: - refs/heads/main diff --git a/Dockerfile b/Dockerfile index c03cdc6..a56a391 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,10 @@ COPY generate_translations.js \ COPY lemmy-translations lemmy-translations COPY src src +COPY .git .git + +# Set UI version +RUN echo "export const VERSION = '$(git describe --tag)';" > "src/shared/version.ts" RUN yarn RUN yarn build:prod diff --git a/src/shared/components/footer.tsx b/src/shared/components/footer.tsx index 16f5fc7..f688bb6 100644 --- a/src/shared/components/footer.tsx +++ b/src/shared/components/footer.tsx @@ -3,6 +3,7 @@ import { Link } from "inferno-router"; import { i18n } from "../i18next"; import { repoUrl, joinLemmyUrl, docsUrl } from "../utils"; import { GetSiteResponse } from "lemmy-js-client"; +import { VERSION } from "../version"; interface FooterProps { site: GetSiteResponse; @@ -19,7 +20,10 @@ export class Footer extends Component {