diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0a3a5f5..8d32bac 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 }} \ No newline at end of file + SSH_KEY: ${{ secrets.SSH_KEY }} + SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }} \ No newline at end of file diff --git a/deploy.sh b/deploy.sh index 2c364c7..2f2e0b7 100755 --- a/deploy.sh +++ b/deploy.sh @@ -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