yml文件

    1. name: Build app and deploy to aliyun
    2. on:
    3. #监听push操作
    4. push:
    5. branches:
    6. # master分支,你也可以改成其他分支
    7. - main
    8. jobs:
    9. build:
    10. runs-on: ubuntu-latest
    11. steps:
    12. - uses: actions/checkout@v1
    13. - name: Install Node.js
    14. uses: actions/setup-node@v1
    15. with:
    16. node-version: '16.17.0'
    17. - name: Install npm dependencies
    18. run: yarn install
    19. - name: Run build task
    20. run: yarn build
    21. - name: copy file via ssh password
    22. uses: appleboy/scp-action@master
    23. with:
    24. host: ${{ secrets.REMOTE_HOST }}
    25. username: ${{ secrets.REMOTE_USER }}
    26. password: ${{ secrets.REMOTE_PASS }}
    27. port: 22
    28. source: "build"
    29. target: "/www/wwwroot/www.xiumubai.com/"

    https://github.com/xiumubai/me/blob/main/.github/workflows/ci.yml