From b317731748bc40001cab06ca8fe0ffb186f39b8e Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Thu, 2 Feb 2023 13:27:50 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9VERSION=E4=BC=A0?= =?UTF-8?q?=E9=80=92=E6=96=B9=E5=BC=8F=EF=BC=8C=E4=BB=8Eenv=E6=94=B9?= =?UTF-8?q?=E4=B8=BAbuild-arg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-publish.yml | 3 +-- Dockerfile | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 774e9e19..4d31ea87 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -44,5 +44,4 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - env: - VERSION: docker-${{ steps.meta.outputs.tags }} + build-args: VERSION=docker-${{ steps.meta.outputs.tags }} diff --git a/Dockerfile b/Dockerfile index e6b9d752..614a217a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM node:lts-alpine +# use with --build-arg VERSION=xxxx +ARG VERSION + # Working directory WORKDIR /app/tailchat @@ -31,6 +34,7 @@ RUN pnpm install # Build and cleanup (client and server) ENV NODE_ENV=production +ENV VERSION=$VERSION RUN pnpm run build # web static service port