From 5069eb5fcc08c36496c243ec948b225252c3302f Mon Sep 17 00:00:00 2001 From: C Date: Sun, 28 Dec 2025 12:11:17 +0800 Subject: [PATCH] Restrict deploy to tagged builds --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ .github/workflows/nightly.yml | 23 ----------------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c4a7084..28cbe89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,3 +104,28 @@ jobs: generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + deploy-to-server: + needs: release + if: startsWith(github.ref, 'refs/tags/v') && needs.release.result == 'success' + runs-on: namespace-profile-default + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Add SSH Private Key + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY_PROD }} + + - name: Deploy to Server + run: | + ssh -o StrictHostKeyChecking=no ubuntu@43.153.9.233 ' + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && + cd /home/ubuntu/service/wavespeed-desktop && + git reset --hard origin/main && + git pull && + npm install && + npm run build + ' diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 648d062..055b6bc 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -172,26 +172,3 @@ jobs: draft: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - deploy-to-server: - runs-on: namespace-profile-default - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Add SSH Private Key - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY_PROD }} - - - name: Deploy to Server - run: | - ssh -o StrictHostKeyChecking=no ubuntu@43.153.9.233 ' - export NVM_DIR="$HOME/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && - cd /home/ubuntu/service/wavespeed-desktop && - git reset --hard origin/main && - git pull && - npm install && - npm run build - '