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