Skip to content

Commit

Permalink
fix: 前台404 #12
Browse files Browse the repository at this point in the history
  • Loading branch information
Mereithhh committed Jul 4, 2023
1 parent efdbd84 commit 7a14cb4
Show file tree
Hide file tree
Showing 4 changed files with 2,668 additions and 1,411 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,25 @@ jobs:
go-version: 1.17
- name: build public files
run: |
npm install -g yarn
npm install -g pnpm
echo "清空原有数据"
rm -rf ./public
mkdir -p public/admin
echo '构建用户页面'
cd ui/website && yarn && yarn build && cd ../../
cd ui/website && pnpm i && pnpm build && cd ../../
cp -r ui/website/build/* public/
echo '构建管理页面'
cd ui/admin && yarn && yarn build && cd ../../
cd ui/admin && pnpm i && pnpm build && cd ../../
cp -r ui/admin/dist/* public/admin/
sed -i 's/\/assets/\/admin\/assets/g' public/admin/index.html
echo '构建前端数据完成'
ls public/static
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: v1.18.2
args: release --clean
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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:18-alpine AS feBuilder
WORKDIR /app
# RUN apk add --no-cache g++ gcc make python3
COPY . .
RUN cd /app && cd ui/admin && yarn && yarn build && cd ../..
RUN cd ui/website && yarn && yarn build && cd ../..
RUN npm i -g pnpm
RUN cd /app && cd ui/admin && pnpm i && pnpm build && cd ../..
RUN cd ui/website && pnpm i && pnpm build && cd ../..
RUN cd /app && mkdir -p public/admin
RUN cp -r ui/website/build/* public/
RUN cp -r ui/admin/dist/* public/admin/
Expand Down
14 changes: 14 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

echo "清空原有数据"
rm -rf ./public
mkdir -p public/admin
echo '构建用户页面'
cd ui/website && pnpm build && cd ../../
cp -r ui/website/build/* public/
echo '构建管理页面'
cd ui/admin && pnpm build && cd ../../
cp -r ui/admin/dist/* public/admin/
sed -i 's/\/assets/\/admin\/assets/g' public/admin/index.html
echo '构建前端数据完成'

go build .
Loading

0 comments on commit 7a14cb4

Please sign in to comment.