fix:homepage and update ci
This commit is contained in:
12
.github/workflows/ci.yaml
vendored
12
.github/workflows/ci.yaml
vendored
@ -11,7 +11,6 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
# job id: 是 job 的唯一标识
|
# job id: 是 job 的唯一标识
|
||||||
build_and_deploy:
|
build_and_deploy:
|
||||||
# 在 Github 中显示的 job 名称
|
|
||||||
name: Build and Deploy
|
name: Build and Deploy
|
||||||
# job 运行的环境配置
|
# job 运行的环境配置
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -36,26 +35,21 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-node-
|
${{ runner.os }}-node-
|
||||||
- name: Use Node.js
|
- name: Use Node.js
|
||||||
# 配置 Node 执行环境(当前构建的服务器默认没有 Node 环境,可以通过 Action 安装 Node)
|
|
||||||
# https://github.com/actions/setup-node
|
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 14
|
node-version: 16
|
||||||
- name: Build
|
- name: Build
|
||||||
# 安装 Node 之后就可以执行构建脚本
|
|
||||||
run: |
|
run: |
|
||||||
npm install yarn -g
|
npm install yarn -g
|
||||||
yarn
|
yarn
|
||||||
yarn build
|
yarn build
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
# 将构建产物 commit 到一个分支上,用于发布静态站点资源
|
|
||||||
# https://github.com/peaceiris/actions-gh-pages
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
# Github 会在 workflow 中自动生成 GIHUBT_TOKEN,用于认证 workflow 的运行
|
# Github 会在 workflow 中自动生成 GIHUBT_TOKEN,用于认证 workflow 的运行
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.ACCESS_TOKEN }}
|
||||||
# 静态资源目录设置
|
# 静态资源目录设置
|
||||||
publish_dir: ./build
|
publish_dir: ./build
|
||||||
# 默认发布到 gh-pages 分支上,可以指定特定的发布分支(不能选拉取代码的分支)
|
# 默认发布到 gh-pages 分支上,可以指定特定的发布分支(不能选拉取代码的分支)
|
||||||
publish_branch: gh-pages
|
publish_branch: gh-pages
|
||||||
full_commit_message: ${{ github.event.head_commit.message }}
|
full_commit_message: ${{ github.event.head_commit.message }}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
"name": "gemini-viewer-demo",
|
"name": "gemini-viewer-demo",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"homepage": "/gemini-viewer-examples/",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/autocomplete": "^6.3.0",
|
"@codemirror/autocomplete": "^6.3.0",
|
||||||
"@codemirror/commands": "^6.1.2",
|
"@codemirror/commands": "^6.1.2",
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"title": "图纸",
|
"title": "图纸",
|
||||||
"subMenus": [{
|
"subMenus": [{
|
||||||
"title": "本地图纸加载",
|
"title": "本地图纸加载",
|
||||||
"url": "../demo/empty_dxf_project.html"
|
"url": "./demo/empty_dxf_project.html"
|
||||||
}, {
|
}, {
|
||||||
"title": "Rac basic sample project",
|
"title": "Rac basic sample project",
|
||||||
"url": "./demo/dxf_0.html"
|
"url": "./demo/dxf_0.html"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import './App.css'
|
import './App.css'
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
import { RecoilRoot } from "recoil";
|
import { RecoilRoot } from "recoil";
|
||||||
import { Routes, Route } from "react-router-dom";
|
import { Routes, Route } from 'react-router-dom';
|
||||||
import Demo from './pages/demo';
|
import Demo from './pages/demo';
|
||||||
|
|
||||||
const App: FC = () => {
|
const App: FC = () => {
|
||||||
|
@ -10,7 +10,7 @@ const root = ReactDOM.createRoot(
|
|||||||
);
|
);
|
||||||
root.render(
|
root.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<HashRouter>
|
<HashRouter basename="">
|
||||||
<App />
|
<App />
|
||||||
</HashRouter>
|
</HashRouter>
|
||||||
</React.StrictMode>
|
</React.StrictMode>
|
||||||
|
@ -8,7 +8,7 @@ function Demo() {
|
|||||||
const [data, setData] = useState<MenusProp[]>([]);
|
const [data, setData] = useState<MenusProp[]>([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetch("../config.json").then(data => data.json()).then((data) => {
|
fetch("../gemini-viewer-examples/config.json").then(data => data.json()).then((data) => {
|
||||||
setData(data);
|
setData(data);
|
||||||
});
|
});
|
||||||
}, [])
|
}, [])
|
||||||
|
Reference in New Issue
Block a user