chore(deps): bump tdesign-vue-next from 1.15.5 to 1.17.6 in /frontend… #50
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: Build and Deploy | |
| on: | |
| push: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Aliyun Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.ALIYUN_REGISTRY }} | |
| username: ${{ secrets.ALIYUN_USERNAME }} | |
| password: ${{ secrets.ALIYUN_PASSWORD }} | |
| - name: Build and push backend image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./backend | |
| push: true | |
| tags: | | |
| ${{ secrets.ALIYUN_REGISTRY }}:latest | |
| ${{ secrets.ALIYUN_REGISTRY }}:${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64 | |
| - name: Deploy to server | |
| run: | | |
| echo "${{ secrets.SSH_PRIVATE_KEY }}" > deploy_key | |
| chmod 600 deploy_key | |
| ssh -i deploy_key -o StrictHostKeyChecking=no ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} << 'EOF' | |
| cd ${{ secrets.SERVER_PATH }} | |
| # 拉取最新镜像 | |
| docker compose pull | |
| # 重启服务 | |
| docker compose up -d | |
| # 清理旧镜像 | |
| docker image prune -f | |
| EOF | |
| # 清理本地密钥 | |
| rm -f deploy_key |