mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2026-03-13 10:02:05 +08:00
添加 action 自动化部署
This commit is contained in:
28
.github/workflows/deploy.yml
vendored
Normal file
28
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: Deploy site files
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master # 只在master上push触发部署
|
||||
paths-ignore: # 下列文件的变更不触发部署,可以自行添加
|
||||
- README.md
|
||||
- LICENSE
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest # 使用ubuntu系统镜像运行自动化脚本
|
||||
|
||||
steps: # 自动化步骤
|
||||
- uses: actions/checkout@v2 # 第一步,下载代码仓库
|
||||
|
||||
- name: Deploy to Server # 第二步,rsync推文件
|
||||
uses: AEnterprise/rsync-deploy@v1.0 # 使用别人包装好的步骤镜像
|
||||
env:
|
||||
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} # 引用配置,SSH私钥
|
||||
ARGS: -avz --delete --exclude='*.pyc' # rsync参数,排除.pyc文件
|
||||
SERVER_PORT: '22' # SSH端口
|
||||
FOLDER: ./website #推送的文件夹,路径相对于代码仓库的根目录
|
||||
SERVER_IP: ${{ secrets.SSH_HOST }} # 引用配置,服务器的host名(IP或者域名domain.com)
|
||||
USERNAME: ${{ secrets.SSH_USERNAME }} # 引用配置,服务器登录名
|
||||
SERVER_DESTINATION: /var/www/books/leetcode/ # 部署到目标文件夹
|
||||
Reference in New Issue
Block a user