Skip to content

Commit

Permalink
refactor: 前端整合成一个,ui 优化,路由懒加载
Browse files Browse the repository at this point in the history
  • Loading branch information
Mereithhh committed Dec 7, 2024
1 parent 2ce2791 commit ccfb4c9
Show file tree
Hide file tree
Showing 101 changed files with 1,819 additions and 2,688 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/node_modules
**/dist
**/build
**/build
public
22 changes: 8 additions & 14 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,27 @@ name: DockerBuild And Deploy
on:
push:
tags:
- 'v*'
- "v*"

jobs:

docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: get image name
- name: get image name
run: |
VERSION=$(cat ./version.txt)
VERSION=${GITHUB_REF#refs/tags/v}
DOCKER_IMAGE_NAME=$(echo "docker.io/mereith/van-nav:v${VERSION}")
DOCKER_IMAGE_NAME_LATEST=$(echo "docker.io/mereith/van-nav:latest")
echo ${VERSION}
Expand Down Expand Up @@ -63,4 +57,4 @@ jobs:
command: set image deployment/plg-tools -n self-tools tool=${{ steps.image-name.outputs.DOCKER_IMAGE_NAME }}
- name: send Message To me
run: |
curl -X POST -H "Content-Type: application/json" -d '{"source":"github-ci:van-nav","message":"流水线运行完毕,k8s, k3s 已部署。\n版本: ${{ github.ref_name }}" }' ${{ secrets.WEBHOOK_URL }}
curl -X POST -H "Content-Type: application/json" -d '{"source":"github-ci:van-nav","message":"流水线运行完毕,k8s, k3s 已部署。\n版本: ${{ github.ref_name }}" }' ${{ secrets.WEBHOOK_URL }}
24 changes: 8 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,32 @@ name: GoReleaser
on:
push:
tags:
- 'v*'
- "v*"

jobs:

goreleaser:
runs-on: ubuntu-20.04
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: '18.14.1'
-
name: Set up Go
node-version: "18.14.1"
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: build public files
run: |
echo "清空原有数据"
rm -rf ./public
mkdir -p public/admin
mkdir -p public
echo '构建用户页面'
cd ui/website && yarn install && yarn build && cd ../../
cp -r ui/website/build/* public/
echo '构建管理页面'
cd ui/admin && yarn install && yarn build && cd ../../
cp -r ui/admin/dist/* public/admin/
sed -i 's/\/assets/\/admin\/assets/g' public/admin/index.html
cd ui && pnpm install && pnpm build && cd ..
cp -r ui/build/* public/
echo '构建前端数据完成'
ls public/static
-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ coverage
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt



# Bower dependency directory (https://bower.io/)
bower_components

Expand Down Expand Up @@ -120,5 +118,4 @@ package-lock.json
dist/

public/*
public
act.secret
act.secret
12 changes: 3 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,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 install && yarn build && cd ../..
RUN cd ui/website && yarn install && yarn build && cd ../..
RUN cd /app && mkdir -p public/admin
RUN cp -r ui/website/build/* public/
RUN cp -r ui/admin/dist/* public/admin/
RUN sed -i 's/\/assets/\/admin\/assets/g' public/admin/index.html

RUN cd /app && cd ui && pnpm install && pnpm build && cd ..
RUN cd /app && mkdir -p public
RUN cp -r ui/build/* public/

FROM golang:alpine AS binarybuilder
RUN apk --no-cache --no-progress add git
Expand All @@ -18,7 +13,6 @@ COPY --from=feBuilder /app/public /app/public
RUN cd /app && ls -la && go mod tidy && go build .



FROM alpine:latest
ENV TZ="Asia/Shanghai"
RUN apk --no-cache --no-progress add \
Expand Down
14 changes: 0 additions & 14 deletions build.sh

This file was deleted.

73 changes: 0 additions & 73 deletions nginx-dev/default.conf

This file was deleted.

2 changes: 0 additions & 2 deletions nginx-dev/run.sh

This file was deleted.

28 changes: 0 additions & 28 deletions ui/admin/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions ui/admin/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions ui/admin/index.html

This file was deleted.

29 changes: 0 additions & 29 deletions ui/admin/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions ui/admin/public/robots.txt

This file was deleted.

49 changes: 0 additions & 49 deletions ui/admin/scripts/add.js

This file was deleted.

Loading

0 comments on commit ccfb4c9

Please sign in to comment.