yml文件
name: Build app and deploy to aliyun
on:
#监听push操作
push:
branches:
# master分支,你也可以改成其他分支
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: '16.17.0'
- name: Install npm dependencies
run: yarn install
- name: Run build task
run: yarn build
- name: copy file via ssh password
uses: appleboy/scp-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
password: ${{ secrets.REMOTE_PASS }}
port: 22
source: "build"
target: "/www/wwwroot/www.xiumubai.com/"
https://github.com/xiumubai/me/blob/main/.github/workflows/ci.yml