Skip to content

Commit

Permalink
Fix GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed Dec 10, 2022
1 parent 5b5fdb2 commit 75ef484
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3

- name: Save version info
run: |
git describe --tags > VERSION
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Build Backend
run: |
go mod download
go build -ldflags "-s -w -X 'wechat-server/common.Version=$(git describe --tags)'" -o wechat-server
go build -ldflags "-s -w -X 'wechat-server/common.Version=$(git describe --tags)' -extldflags '-static'" -o wechat-server
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ FROM node:16 as builder

WORKDIR /build
COPY ./web .
COPY ./VERSION .
RUN npm install
RUN npm run build
RUN REACT_APP_VERSION=$(cat VERSION) npm run build

FROM golang AS builder2

Expand All @@ -15,7 +16,7 @@ WORKDIR /build
COPY . .
COPY --from=builder /build/build ./web/build
RUN go mod download
RUN go build -ldflags "-s -w -extldflags '-static'" -o wechat-server
RUN go build -ldflags "-s -w -X 'wechat-server/common.Version=$(cat VERSION)' -extldflags '-static'" -o wechat-server

FROM alpine

Expand Down

0 comments on commit 75ef484

Please sign in to comment.