Merge branch 'main' into develop #61
This file contains hidden or 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
| name: Deploy Website | |
| # 仅当 main 分支上 website/ 目录有变更时触发, | |
| # 通过 SSH 登录服务器执行 deploy.sh 重建并重启容器。 | |
| on: | |
| push: | |
| branches: [develop] | |
| paths: | |
| - "website/**" | |
| workflow_dispatch: {} # 允许在 Actions 页面手动触发 | |
| concurrency: | |
| group: deploy-website | |
| cancel-in-progress: false # 部署不可中途取消,排队执行 | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: SSH 部署 | |
| uses: appleboy/ssh-action@v1.2.0 | |
| with: | |
| host: ${{ secrets.DEPLOY_HOST }} | |
| port: ${{ secrets.DEPLOY_PORT }} | |
| username: ${{ secrets.DEPLOY_USER }} | |
| key: ${{ secrets.DEPLOY_SSH_KEY }} | |
| script_stop: true | |
| script: | | |
| cd ${{ secrets.DEPLOY_PATH }} | |
| bash deploy.sh |