fix: set version info for Docker image
This commit is contained in:
@@ -20,6 +20,10 @@ jobs:
|
|||||||
- name: Check out the repo
|
- name: Check out the repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Save version info
|
||||||
|
run: |
|
||||||
|
git describe --tags > VERSION
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
+3
-2
@@ -2,8 +2,9 @@ FROM node:16 as builder
|
|||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY ./web .
|
COPY ./web .
|
||||||
|
COPY ./VERSION .
|
||||||
RUN npm install
|
RUN npm install
|
||||||
RUN npm run build
|
RUN REACT_APP_VERSION=$(cat VERSION) npm run build
|
||||||
|
|
||||||
FROM golang AS builder2
|
FROM golang AS builder2
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ WORKDIR /build
|
|||||||
COPY . .
|
COPY . .
|
||||||
COPY --from=builder /build/build ./web/build
|
COPY --from=builder /build/build ./web/build
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
RUN go build -ldflags "-s -w -extldflags '-static'" -o message-pusher
|
RUN go build -ldflags "-s -w -X 'gin-template/common.Version=$(cat VERSION)' -extldflags '-static'" -o message-pusher
|
||||||
|
|
||||||
FROM alpine
|
FROM alpine
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user