Skip to content

Commit

Permalink
fix: front build (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
DVKunion committed Mar 29, 2024
1 parent cc04d38 commit 1ab286d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,23 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone seamoon-web repository
uses: actions/checkout@v4
with:
repository: 'DVKunion/seamoon-web'
ref: 'main' # Or any other branch or tag you want to checkout
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: |
npm install
cd web && npm install
- name: Build Front
run: |
npm run build
cp -r dist /tmp
cd web && npm install && npm run build && cp -r dist ../cmd/client/static
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Build
run: |
cp -r /tmp/dist cmd/client/static
go mod tidy
go build -o seamoon -v --ldflags "-s -w -X github.com/DVKunion/SeaMoon/pkg/system/xlog.Version=${{github.ref_name}} -X github.com/DVKunion/SeaMoon/pkg/system/xlog.Commit=${{github.sha}}" cmd/main.go
- uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*.sql

cmd/client/static/dist/*
.umi/
*.log
*.toml
.config
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# build stage
FROM node:20 as front
COPY .. /src
WORKDIR /src/web
RUN npm run build

FROM golang:alpine AS build
ARG VERSION
ARG SHA
Expand All @@ -7,6 +12,7 @@ WORKDIR /src
ENV CGO_ENABLED 0
ENV VERSION=${VERSION}
ENV SHA=${SHA}
COPY --from=front /src/web/dist /src/cmd/client/static
#COPY ./seamoon /tmp/seamoon
RUN go build -v -ldflags "-X github.com/DVKunion/SeaMoon/system/xlog.Version=${VERSION} -X github.com/DVKunion/SeaMoon/system/xlog.Commit=${SHA}" -o /tmp/seamoon cmd/main.go
RUN chmod +x /tmp/seamoon
Expand Down
3 changes: 1 addition & 2 deletions web/src/pages/provider/components/DetailDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import React, {useRef, useState} from 'react';
import type {ProDescriptionsActionType} from '@ant-design/pro-components';
import {ProDescriptions} from '@ant-design/pro-components';
import {FormValueType} from "./CreateForm";
import {Button, Divider, Drawer, Popconfirm, Space, Tag, Tooltip} from "antd";
import {Button, Divider, Drawer, Popconfirm, Space, Tag, Tooltip, Badge} from "antd";
import {CloudProviderStatusEnum, CloudProvideTypeValueEnum, RegionEnum} from "@/enum/cloud";
import {AuthColumns, CloudRegionSelector} from "@/pages/provider/components/AuthForm";
import {SyncOutlined} from "@ant-design/icons";
import {Badge} from "[email protected]@antd";

export type DetailProps = {
onCancel: () => void;
Expand Down
3 changes: 1 addition & 2 deletions web/src/pages/provider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React, {useRef, useState} from "react";
import {PageContainer, ProTable, ActionType, ProColumns} from "@ant-design/pro-components";
import {Button, Popconfirm} from "antd";
import {Button, Popconfirm, Badge, Tooltip} from "antd";
import {PlusOutlined} from "@ant-design/icons";
import {getCloudProvider} from "@/services/cloud/api";
import {handleCreateCloud, handleDeleteCloud, handleSyncCloud, handleUpdateCloud} from './handle';
import {CloudProvideTypeEnum, CloudProviderStatusEnum} from "@/enum/cloud";
import CreateForm from './components/CreateForm';
import DetailDrawer from "./components/DetailDrawer";
import {Badge, Tooltip} from "[email protected]@antd";

const Provider: React.FC = () => {

Expand Down

0 comments on commit 1ab286d

Please sign in to comment.