Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Comment on lines +126 to +128

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Deploy the tagged commit rather than main

Because this job only runs on tag pushes, it implicitly ties the deployment to the tagged release build; however the remote commands explicitly reset to origin/main, so if the tag isn’t exactly the current HEAD of main (e.g., tagging a release branch, or main advancing after the tag is created), production will deploy a different commit than the release artifacts. That mismatch can ship untested code for that release tag. Consider checking out the tag/commit ref on the server instead of resetting to main.

Useful? React with 👍 / 👎.

npm install &&
npm run build
'
23 changes: 0 additions & 23 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
'