-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (28 loc) · 1.01 KB
/
deploy.yml
File metadata and controls
30 lines (28 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: deploy to tencent server
on: # 此CI/CD触发时的事件
push: # 在代码提交时自动触发
branches:
- master
workflow_dispatch:
# 一个 CI/CD 的工作流有许多 jobs 组成,比如最典型的 job 是 lint,test,build。
jobs:
deploy: # 构建job
runs-on: ubuntu-latest # 跑workflow的服务器系统
steps:
- name: executing remote ssh commands
# 使用appleboy/ssh-action@master来执行命令
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SECRET }}
script: |
source /etc/profile
source ~/.bashrc
cd ~/hexo/
service nginx stop
rm -rf licoded.github.io
git clone https://github.com/licoded/licoded.github.io --depth=1
sudo chown -R nginx:nginx licoded.github.io
sudo chmod -R 777 licoded.github.io
service nginx start