-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lijingze
committed
Feb 3, 2024
1 parent
92cf56a
commit f811615
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: 更新项目到服务器 | ||
|
||
on: | ||
push: | ||
# push 代码的时候 哪个分支会受到影响 这里是 v1.0.0 分支 | ||
branches: | ||
- main # 也可以设置为 main 分支 | ||
|
||
# 推送之后执行一系列的任务 | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# 获取代码 | ||
- name: 迁出代码 | ||
# 使用action库 action/checkout获取代码 | ||
uses: actions/checkout@main | ||
# 安装Node环境 | ||
|
||
- name: Use Node.js 18.12.1 | ||
uses: actions/setup-node@main | ||
with: | ||
node-version: "18.12.1" | ||
|
||
# 安装依赖 | ||
- name: 安装依赖 | ||
run: npm install | ||
|
||
# 打包 | ||
- name: 打包 | ||
run: npm run build | ||
# 上传到腾讯云 | ||
- name: 发布到阿里云 | ||
uses: easingthemes/ssh-deploy@main | ||
env: | ||
# 私钥 | ||
SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | ||
# SCP参数 | ||
ARGS: "-avzr --delete" | ||
# 源目录 | ||
SOURCE: "dist/" | ||
# 服务器ip | ||
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | ||
# 用户 | ||
REMOTE_USER: "root" | ||
# 目标地址 | ||
# TARGET: '/var/www/html' | ||
TARGET: "/home/web" | ||
# 推送信息到微信 | ||
# - name: 推送信息到微信 | ||
# uses: easychen/github-action-server-chan@main | ||
# with: | ||
# sendkey: ${{ secrets.SERVER_J }} | ||
# title: '网站更新完毕' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# vitepress-notes | ||
Use vitepress to record study notes for learning front-end related knowledge | ||
|
||
- [x] init | ||
- [x] ci/cd |