Skip to content

Commit

Permalink
try fixing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidingPlus committed Jul 10, 2024
1 parent f92a4b8 commit 1fb7c0f
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# feature-my-homepage 分支推送部署预览
## 仅部署 Win 端
name: Build Source Code

name: Build and Deploy

on:
push:
branches:
- feature-my-homepage

jobs:
release:
build:
name: Build Website
runs-on: windows-latest

Expand Down Expand Up @@ -49,10 +49,22 @@ jobs:
with:
name: Homepage
path: dist

# TODO 以下是自动化将打包的静态页面部署到 gh-pages 分支和我自己服务器的脚本

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

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

- name: Deploy to gh-pages
# 链接 https://github.com/crazy-max/ghaction-github-pages/
uses: crazy-max/[email protected]
Expand All @@ -65,12 +77,22 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

# 部署到我个人的服务器
deploy-server:
name: Deploy to My Own Server
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/[email protected]
with:
name: Homepage
path: public

- name: Deploy to My Own Server
# 链接 https://github.com/easingthemes/ssh-deploy
uses: easingthemes/[email protected]
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
# ARGS: "-rlgoDzvc -i"
ARGS: "-avzr --delete"
SOURCE: "public/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
Expand Down

0 comments on commit 1fb7c0f

Please sign in to comment.