Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonely-Sails committed Aug 29, 2024
2 parents abdf97d + 6cbad82 commit 5f612ec
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: push自动更新

on:
push:
branches:
- main

env:
TZ: Asia/Shanghai

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🚀 检查代码
uses: actions/checkout@v2

- name: 🐧 配置环境
uses: actions/setup-node@v2
with:
node-version: '20'

- name: 🛠️ Build
run: |
npm install
npm run docs:build
- name: 🛠️ Add SSH Key to known_hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: 🛠️ Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: 🚁 部署到服务器
uses: wlixcc/[email protected]
with:
username: ${{ secrets.SSH_USERNAME }}
port: '22'
server: ${{ secrets.SSH_HOST }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
local_path: '.vitepress/dist/*'
remote_path: ${{ secrets.WEB_PATH }}
delete_remote_files: true

0 comments on commit 5f612ec

Please sign in to comment.