1
Fork 0

Fix release version and date in UI. (#1025)

This commit is contained in:
Googol Lee 2024-08-27 21:46:29 +02:00 committed by GitHub
parent bef9e7c666
commit bb66a8b791
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View File

@ -70,3 +70,6 @@ jobs:
push: ${{ github.event_name != 'pull_request' && github.repository == 'photoview/photoview' }} push: ${{ github.event_name != 'pull_request' && github.repository == 'photoview/photoview' }}
tags: ${{ steps.docker_meta.outputs.tags }} tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }} labels: ${{ steps.docker_meta.outputs.labels }}
build-args: |
VERSION=${{ github.ref_name }}
COMMIT_SHA=${{ github.sha }}

View File

@ -29,7 +29,11 @@ COPY ui/package.json ui/package-lock.json /app/ui
RUN npm ci RUN npm ci
COPY ui/ /app/ui COPY ui/ /app/ui
RUN npm run build -- --base=$UI_PUBLIC_URL RUN if [ "$BUILD_DATE" = "" ]; then \
export BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ'); \
export REACT_APP_BUILD_DATE=${BUILD_DATE}; \
fi; \
npm run build -- --base=$UI_PUBLIC_URL
### Build API ### ### Build API ###
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.22-bookworm AS api FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.22-bookworm AS api

View File

@ -220,6 +220,8 @@ It may take a long time to build dependencies when launching servers first time.
```sh ```sh
$ docker build --target ui -t photoview/ui . # Build image for development $ docker build --target ui -t photoview/ui . # Build image for development
$ docker run --rm -it -v `pwd`:/app --network host --env-file ui/example.env photoview/ui \
npm install # Install dependencies
$ docker run --rm -it -v `pwd`:/app --network host --env-file ui/example.env photoview/ui \ $ docker run --rm -it -v `pwd`:/app --network host --env-file ui/example.env photoview/ui \
npm run mon # Monitor source code and (re)launch UI server npm run mon # Monitor source code and (re)launch UI server
``` ```