Skip to content

Commit

Permalink
my-arxiv link
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidingPlus committed Feb 12, 2025
1 parent 631c73e commit cb01738
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
37 changes: 19 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build and Deploy

on:
workflow_dispatch:
push:
branches:
- feature-liuzx-homepage
Expand All @@ -13,13 +14,13 @@ jobs:
steps:
# 检出 Git 仓库
- name: Check out git repository
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4

# 安装 Node.js
- name: Install Node.js
uses: actions/setup-node@v4.0.0
uses: actions/setup-node@v4
with:
node-version: "18.x"
node-version: "20.x"

# 复制环境变量文件
- name: Copy .env.example
Expand All @@ -45,56 +46,56 @@ jobs:
# 上传构建产物
- name: Upload artifacts
# 链接 https://github.com/actions/upload-artifact/
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-artifact@v4
with:
name: Homepage
name: dist
path: dist

# 以下是自动化将打包的静态页面部署到 gh-pages 分支和我自己服务器的脚本
# 为了互不影响,采用并行执行的方式

deploy-gh-pages:
deploy-to-gh-pages:
name: Deploy to gh-pages-deprecated
runs-on: ubuntu-latest
needs: build # 表示依赖于 build 作业完成
steps:
- name: Download artifact
# 链接 https://github.com/actions/download-artifact
uses: actions/download-artifact@v4.0.0
uses: actions/download-artifact@v4
with:
name: Homepage
name: dist
path: dist

- name: Deploy to gh-pages-deprecated
# 链接 https://github.com/crazy-max/ghaction-github-pages/
uses: crazy-max/ghaction-github-pages@v4.0.0
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages-deprecated
build_dir: dist
keep_history: false # 同 blog,关闭 git 历史
# fqdn: xxx 自定义域名
keep_history: false
# fqdn: xxx
allow_empty_commit: false
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

deploy-server:
name: Deploy to My Own Server
deploy-to-my-server:
name: Deploy to My Server
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4.0.0
uses: actions/download-artifact@v4
with:
name: Homepage
path: public
name: dist
path: dist

- name: Deploy to My Own Server
# 链接 https://github.com/easingthemes/ssh-deploy
uses: easingthemes/ssh-deploy@v5.0.0
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-avzr --times --update --delete"
SOURCE: "public/"
SOURCE: "dist/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.TARGET }}
2 changes: 1 addition & 1 deletion src/assets/siteLinks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
"icon": "Newspaper",
"name": "My Arxiv",
"link": "https://davidingplus.github.io/my-arxiv/"
"link": "https://my-arxiv.davidingplus.cn/"
},
{
"icon": "CompactDisc",
Expand Down

0 comments on commit cb01738

Please sign in to comment.