Skip to content

Commit

Permalink
fixed ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
eneoli committed Sep 5, 2024
1 parent 8d67d57 commit 1bc1351
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ jobs:
DEPLOYMENT_RES_PATH: ${{ vars.DEPLOYMENT_RES_PATH }}
DEPLOYMENT_SERVER: ${{ vars.DEPLOYMENT_SERVER }}
DEPLOYMENT_USER: ${{ vars.DEPLOYMENT_USER }}
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }}
9 changes: 7 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,19 @@ echo ""

cd frontend
npm install
npm run build:$BUILD_MODE
npm run bui
ld:$BUILD_MODE
cd ..

echo ""
echo "--> Uploading to deployment server..."
echo ""

ssh-add - <<< "${SSH_KEY}"
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/deploy.key
sudo chmod 600 ~/.ssh/deploy.key
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_host

ssh $DEPLOYMENT_USER@$DEPLOYMENT_SERVER "rm -rf $DEPLOYMENT_RES_PATH/*"
scp -r dist $DEPLOYMENT_USER@$DEPLOYMENT_SERVER:$DEPLOYMENT_RES_PATH

Expand Down

0 comments on commit 1bc1351

Please sign in to comment.