-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
4 changed files
with
59 additions
and
3 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
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,28 @@ | ||
name: Build and Deploy | ||
on: # 监听 main 分支上的 push 事件 | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest # 构建环境使用 ubuntu | ||
steps: | ||
- name: Checkout # 将代码拉到虚拟机 | ||
uses: actions/[email protected] | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Install and Build # 下载依赖 打包项目 | ||
run: | | ||
npm i -g pnpm | ||
pnpm install | ||
pnpm run build | ||
- name: Deploy to remote 🚀 # 部署到服务器 | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.REMOTE_HOST }} | ||
username: ${{ secrets.REMOTE_USERNAME }} | ||
password: ${{ secrets.REMOTE_PASSWORD }} | ||
port: 22 | ||
source: 'dist/' | ||
target: ${{ secrets.REMOTE_TARGET }} |
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
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