Skip to content

Commit c3de224

Browse files
committed
update
1 parent 4ebc28b commit c3de224

File tree

6 files changed

+68
-86
lines changed

6 files changed

+68
-86
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflow

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/deploy.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# .github/workflows/deploy.yml
2+
3+
name: Deploy to GitHub Pages
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
env:
11+
NODE_VERSION: '16.x' # 您已更改为 Node.js 16.x
12+
13+
permissions: # <--- 添加这个 permissions 块
14+
contents: write # 允许 GITHUB_TOKEN 对仓库内容进行写操作(例如推送分支)
15+
16+
jobs:
17+
build-and-deploy:
18+
name: Build and Deploy
19+
runs-on: ubuntu-latest
20+
# 或者在这里为特定作业设置权限:
21+
# permissions:
22+
# contents: write
23+
24+
steps:
25+
- name: Checkout 🛎️
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Node.js ${{ env.NODE_VERSION }} ⚙️
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: ${{ env.NODE_VERSION }}
32+
cache: 'yarn'
33+
34+
- name: Install dependencies 📦
35+
run: yarn install --frozen-lockfile
36+
37+
- name: Update Browserslist database (optional but recommended)
38+
run: npx browserslist@latest --update-db
39+
40+
- name: Build project 🛠️
41+
run: yarn build
42+
# 如果您在使用 Node 16 时仍然遇到 OpenSSL 错误 (不太可能,但以防万一)
43+
# 您可能仍然需要 NODE_OPTIONS。但通常 Node 16 是可以的。
44+
# env:
45+
# NODE_OPTIONS: --openssl-legacy-provider
46+
47+
# 可选步骤:列出 dist 目录内容,以验证构建输出
48+
- name: List build directory contents
49+
run: ls -R ./dist
50+
51+
- name: Deploy to GitHub Pages 🚀
52+
uses: peaceiris/actions-gh-pages@v4
53+
with:
54+
github_token: ${{ secrets.GITHUB_TOKEN }}
55+
publish_dir: ./dist
56+
# publish_branch: gh-pages # 默认是 gh-pages,可以省略
57+
# user_name: 'github-actions[bot]' # 自定义提交者名称 (可选)
58+
# user_email: 'github-actions[bot]@users.noreply.github.com' # 自定义提交者邮箱 (可选)
59+
# commit_message: ${{ github.event.head_commit.message }} # 使用最后一次提交的消息作为部署提交消息 (可选)
60+
# cname: your-custom-domain.com # 如果您使用自定义域名,请取消注释并替换

.github/workflows/static.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

vue.config.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
// vue.config.js
12
module.exports = {
2-
transpileDependencies: ["vuetify"],
3-
pwa: {
3+
// ...其他配置
4+
publicPath: process.env.NODE_ENV === 'production'
5+
? '/sosconf2020/' // 将 <REPONAME> 替换为您的 GitHub 仓库名称
6+
: '/',
7+
transpileDependencies: ["vuetify"], // 从您上传的文件中保留
8+
pwa: { // 从您上传的文件中保留
49
name: "SOSCONF.zh 2020",
510
themeColor: "#589bad"
611
}
7-
};
12+
};

0 commit comments

Comments
 (0)