mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 08:27:22 +00:00
Changed to pass build arg & create NEXT envar
This commit is contained in:
@@ -98,18 +98,9 @@ jobs:
|
|||||||
infisical/frontend:${{ steps.extract_version.outputs.version }}
|
infisical/frontend:${{ steps.extract_version.outputs.version }}
|
||||||
build-args: |
|
build-args: |
|
||||||
POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }}
|
POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }}
|
||||||
|
NEXT_INFISICAL_PLATFORM_VERSION=${{ steps.extract_version.outputs.version }}
|
||||||
labels: |
|
labels: |
|
||||||
version=${{ steps.extract_version.outputs.version }}
|
version=${{ steps.extract_version.outputs.version }}
|
||||||
- name: 🛠️ Create or update Infisical version in version.ts file
|
|
||||||
run: |
|
|
||||||
version='${{ steps.extract_version.outputs.version }}'
|
|
||||||
file='frontend/src/version.ts'
|
|
||||||
touch "$file"
|
|
||||||
if grep -q "export const CURRENT_INFISICAL_VERSION = '.*';" "$file"; then
|
|
||||||
sed -i "s/export const CURRENT_INFISICAL_VERSION = '.*';/export const CURRENT_INFISICAL_VERSION = '$version';/" "$file"
|
|
||||||
else
|
|
||||||
echo "export const INFISICAL_VERSION = '$version';" >> "$file"
|
|
||||||
fi
|
|
||||||
- name: ⏻ Spawn frontend container
|
- name: ⏻ Spawn frontend container
|
||||||
run: |
|
run: |
|
||||||
docker run -d --rm --name infisical-frontend-test infisical/frontend:test
|
docker run -d --rm --name infisical-frontend-test infisical/frontend:test
|
||||||
@@ -132,5 +123,6 @@ jobs:
|
|||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
build-args: |
|
build-args: |
|
||||||
POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }}
|
POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }}
|
||||||
|
NEXT_INFISICAL_PLATFORM_VERSION=${{ steps.extract_version.outputs.version }}
|
||||||
labels: |
|
labels: |
|
||||||
version=${{ steps.extract_version.outputs.version }}
|
version=${{ steps.extract_version.outputs.version }}
|
||||||
+4
-1
@@ -1,6 +1,7 @@
|
|||||||
ARG POSTHOG_HOST=https://app.posthog.com
|
ARG POSTHOG_HOST=https://app.posthog.com
|
||||||
ARG POSTHOG_API_KEY=posthog-api-key
|
ARG POSTHOG_API_KEY=posthog-api-key
|
||||||
ARG INTERCOM_ID=intercom-id
|
ARG INTERCOM_ID=intercom-id
|
||||||
|
ARG NEXT_INFISICAL_PLATFORM_VERSION=next-infisical-platform-version
|
||||||
|
|
||||||
FROM node:16-alpine AS deps
|
FROM node:16-alpine AS deps
|
||||||
# Install dependencies only when needed. Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
# Install dependencies only when needed. Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
||||||
@@ -13,7 +14,6 @@ COPY package.json package-lock.json next.config.js ./
|
|||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN npm ci --only-production --ignore-scripts
|
RUN npm ci --only-production --ignore-scripts
|
||||||
|
|
||||||
|
|
||||||
# Rebuild the source code only when needed
|
# Rebuild the source code only when needed
|
||||||
FROM node:16-alpine AS builder
|
FROM node:16-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -52,6 +52,9 @@ ENV NEXT_PUBLIC_POSTHOG_API_KEY=$POSTHOG_API_KEY \
|
|||||||
ARG INTERCOM_ID
|
ARG INTERCOM_ID
|
||||||
ENV NEXT_PUBLIC_INTERCOM_ID=$INTERCOM_ID \
|
ENV NEXT_PUBLIC_INTERCOM_ID=$INTERCOM_ID \
|
||||||
BAKED_NEXT_PUBLIC_INTERCOM_ID=$INTERCOM_ID
|
BAKED_NEXT_PUBLIC_INTERCOM_ID=$INTERCOM_ID
|
||||||
|
ARG NEXT_INFISICAL_PLATFORM_VERSION
|
||||||
|
ENV NEXT_PUBLIC_INFISICAL_PLATFORM_VERSION=$NEXT_INFISICAL_PLATFORM_VERSION \
|
||||||
|
BAKED_NEXT_PUBLIC_INFISICAL_PLATFORM_VERSION=$NEXT_INFISICAL_PLATFORM_VERSION
|
||||||
|
|
||||||
COPY --chown=nextjs:nodejs --chmod=555 scripts ./scripts
|
COPY --chown=nextjs:nodejs --chmod=555 scripts ./scripts
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ import {
|
|||||||
useLogoutUser,
|
useLogoutUser,
|
||||||
useUploadWsKey
|
useUploadWsKey
|
||||||
} from "@app/hooks/api";
|
} from "@app/hooks/api";
|
||||||
import { CURRENT_INFISICAL_VERSION } from "@app/version"
|
|
||||||
|
|
||||||
interface LayoutProps {
|
interface LayoutProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
@@ -700,7 +699,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
|
|||||||
)}
|
)}
|
||||||
<div className="mb-2 w-full pl-5 duration-200 hover:text-mineshaft-200">
|
<div className="mb-2 w-full pl-5 duration-200 hover:text-mineshaft-200">
|
||||||
<FontAwesomeIcon icon={faInfo} className="mr-4 px-[0.1rem]" />
|
<FontAwesomeIcon icon={faInfo} className="mr-4 px-[0.1rem]" />
|
||||||
Current version: {CURRENT_INFISICAL_VERSION}
|
Platform Version: {process.env.NEXT_PUBLIC_INFISICAL_PLATFORM_VERSION || "N/A"}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export const CURRENT_INFISICAL_VERSION = "v1.1.1"; // placeholder - dynamically updated on prod build
|
|
||||||
Reference in New Issue
Block a user