Skip to content

Commit c530ee4

Browse files
committed
更新内容+action自动部署
1 parent ec8f1c4 commit c530ee4

File tree

218 files changed

+1140
-1062
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+1140
-1062
lines changed

.github/workflows/ci.yml

Lines changed: 91 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,108 @@
1+
# name: CI
2+
3+
# #on: [push]
4+
5+
# # 在master分支发生push事件时触发。
6+
# on:
7+
# push:
8+
# branches:
9+
# - master
10+
11+
# env: # 设置环境变量
12+
# TZ: Asia/Shanghai # 时区(设置时区可使页面中的`最近更新时间`使用该时区时间)
13+
14+
# jobs:
15+
# build: # 自定义名称
16+
# runs-on: ubuntu-latest # 运行在虚拟机环境ubuntu-latest
17+
18+
# strategy:
19+
# matrix:
20+
# node-version: [18.x]
21+
22+
# steps:
23+
# - name: Checkout # 步骤1
24+
# uses: actions/checkout@v1 # 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions
25+
# - name: Use Node.js ${{ matrix.node-version }} # 步骤2
26+
# uses: actions/setup-node@v3 # 作用:安装nodejs
27+
# with:
28+
# node-version: ${{ matrix.node-version }} # 版本
29+
# - name: Build-and-deploy # 步骤3
30+
# run: |
31+
# remote_addr=`git remote get-url --push origin`
32+
# commit_info=`git describe --all --always --long`
33+
# user_name=`git log -1 --pretty=format:'%an'`
34+
# user_email=`git log -1 --pretty=format:'%ae'`
35+
# deploy_branch=gh-pages
36+
# yarn
37+
# yarn build
38+
# cd docs/.vuepress/dist
39+
# git config --global init.defaultBranch $deploy_branch
40+
# git init
41+
# git config user.name ${user_name}
42+
# git config user.email ${user_email}
43+
# git add -A
44+
# git commit -m "auto deploy, $commit_info"
45+
# remote_addr=`echo $remote_addr | awk -F'://' '{print $2}'`
46+
# remote_addr=https://${user_name}:${{secrets.GITHUB_TOKEN}}@${remote_addr}
47+
# git remote add origin ${remote_addr}
48+
# git push origin HEAD:$deploy_branch --force # 推送到github $deploy_branch分支
49+
50+
51+
52+
153
name: CI
254

355
#on: [push]
456

5-
# 在master分支发生push事件时触发
6-
on:
57+
# 在 master 分支发生 push 事件时触发
58+
on:
759
push:
860
branches:
961
- master
10-
62+
1163
env: # 设置环境变量
12-
TZ: Asia/Shanghai # 时区(设置时区可使页面中的`最近更新时间`使用该时区时间
64+
TZ: Asia/Shanghai # 时区(设置时区可使页面中的 最近更新时间 使用时区时间
1365

14-
jobs:
66+
jobs: # 工作流
1567
build: # 自定义名称
16-
runs-on: ubuntu-latest # 运行在虚拟机环境ubuntu-latest
68+
runs-on: ubuntu-latest # 必填,运行在虚拟机环境 ubuntu-latest
1769

1870
strategy:
1971
matrix:
20-
node-version: [18.x]
72+
node-version: [14.x]
2173

22-
steps:
23-
- name: Checkout # 步骤1
24-
uses: actions/checkout@v1 # 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions
74+
steps: # 步骤1
75+
- name: Checkout # 步骤1,拉取代码
76+
# 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions
77+
uses: actions/checkout@v1
78+
2579
- name: Use Node.js ${{ matrix.node-version }} # 步骤2
26-
uses: actions/setup-node@v3 # 作用:安装nodejs
80+
uses: actions/setup-node@v1 # 作用:安装nodejs
2781
with:
2882
node-version: ${{ matrix.node-version }} # 版本
29-
- name: Build-and-deploy # 步骤3
30-
run: |
31-
remote_addr=`git remote get-url --push origin`
32-
commit_info=`git describe --all --always --long`
33-
user_name=`git log -1 --pretty=format:'%an'`
34-
user_email=`git log -1 --pretty=format:'%ae'`
35-
deploy_branch=gh-pages
36-
yarn
37-
yarn build
38-
cd docs/.vuepress/dist
39-
git config --global init.defaultBranch $deploy_branch
40-
git init
41-
git config user.name ${user_name}
42-
git config user.email ${user_email}
43-
git add -A
44-
git commit -m "auto deploy, $commit_info"
45-
remote_addr=`echo $remote_addr | awk -F'://' '{print $2}'`
46-
remote_addr=https://${user_name}:${{secrets.GITHUB_TOKEN}}@${remote_addr}
47-
git remote add origin ${remote_addr}
48-
git push origin HEAD:$deploy_branch --force # 推送到github $deploy_branch分支
83+
84+
- name: run deploy.sh # 步骤3:执行脚本 deploy.sh
85+
env: # 设置环境变量,未设置则不运行
86+
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} # token
87+
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }} # 私钥
88+
run: npm install && npm run deploy # 执行 deploy.sh 脚本,位于项目根目录
89+
90+
# - name: Push Matser To Gitee # 步骤4:GitHub 内容同步到 Gitee,同步仓库是 master
91+
# uses: wearerequired/git-mirror-action@master
92+
# env:
93+
# SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
94+
# with: # 从源到目的地
95+
# source-repo: '[email protected]:Kele-Bingtang/notes-blog.git' #Github 仓库地址
96+
# destination-repo: '[email protected]:kele-bingtang/notes-blog.git' #Gitee 仓库地址
97+
98+
- name: Build Gitee Pages # 步骤5:自动部署到 Gitee Pages
99+
uses: yanglbme/gitee-pages-action@master
100+
with:
101+
# 注意替换为你的 Gitee 用户名
102+
gitee-username: jywangyou
103+
# 注意在 Settings -> Secrets 配置 GITEE_PASSWORD
104+
gitee-password: ${{ secrets.GITEE_PASSWORD }}
105+
# 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错
106+
gitee-repo: jywangyou/notes-blog
107+
# 要部署的分支,默认是 master,若是其他分支,则需要指定(指定的分支必须存在)
108+
branch: gh-pages

docs/.vuepress/components/Fantasy.vue

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -277,26 +277,26 @@
277277
278278
// 奇妙的屏幕大小自适应
279279
window.onresize = function () {
280-
// display.width = window.innerWidth;
281-
// if (window.innerWidth / window.innerHeight > 1.8333333333333) {
282-
// display.height = (window.innerWidth / 1980) * 1080;
283-
// // window.scrollTo(0, (window.innerHeight - 123) / 16);
284-
// } else {
285-
// display.height = window.innerHeight;
286-
// }
287-
288-
289-
var devicePixelRatio = window.devicePixelRatio || 1;
290-
display.width = window.innerWidth * devicePixelRatio;
291-
display.height = window.innerHeight * devicePixelRatio;
292-
// 设置画布的 CSS 尺寸为所需的尺寸
293-
display.style.width = window.innerWidth + 'px';
294-
display.style.height = window.innerHeight + 'px';
280+
display.width = window.innerWidth;
295281
if (window.innerWidth / window.innerHeight > 1.8333333333333) {
296-
display.height = (window.innerWidth / 1980) * 1080 * devicePixelRatio;
282+
display.height = (window.innerWidth / 1980) * 1080;
283+
// window.scrollTo(0, (window.innerHeight - 123) / 16);
284+
} else {
285+
display.height = window.innerHeight;
297286
}
298-
// 根据 devicePixelRatio 更新上下文的比例
299-
displayCtx.scale(devicePixelRatio, devicePixelRatio);
287+
288+
289+
// var devicePixelRatio = window.devicePixelRatio || 1;
290+
// display.width = window.innerWidth * devicePixelRatio;
291+
// display.height = window.innerHeight * devicePixelRatio;
292+
// // 设置画布的 CSS 尺寸为所需的尺寸
293+
// display.style.width = window.innerWidth + 'px';
294+
// display.style.height = window.innerHeight + 'px';
295+
// if (window.innerWidth / window.innerHeight > 1.8333333333333) {
296+
// display.height = (window.innerWidth / 1980) * 1080 * devicePixelRatio;
297+
// }
298+
// // 根据 devicePixelRatio 更新上下文的比例
299+
// displayCtx.scale(devicePixelRatio, devicePixelRatio);
300300
};
301301
302302
window.onresize();

docs/.vuepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export default defineConfig4CustomTheme<VdoingThemeConfig>({
173173

174174
// 博主信息 (显示在首页侧边栏)
175175
blogger: {
176-
avatar: 'https://cdn.statically.io/gh/jywangyou/picx-images-hosting@master/xiaohei.5g9w47ni9lo0.webp',
176+
avatar: 'https://cdn.statically.io/gh/jywangyou/picx-images-hosting@master/head.279i4ncb6yas.jpg',
177177
name: 'Kronos',
178178
slogan: '纵有疾风起,人生不言弃',
179179
},

0 commit comments

Comments
 (0)