diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 27d000f..3502ad0 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -17,10 +17,13 @@ jobs: steps: - name: Setup SSH run: | + which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) + eval $(ssh-agent -s) + ssh-add <(echo "$SSH_PRIVATE_KEY" ) mkdir -p ~/.ssh chmod 700 ~/.ssh - echo 'echo $SSH_PASSPHRASE' > ~/.ssh/passphrase && chmod 700 ~/.ssh/passphrase - SSH_ASKPASS_REQUIRE=force SSH_ASKPASS="/root/.ssh/pass" ssh-add $SSH_PRIVATE_KEY + ssh-keyscan $SERVER_IP >> ~/.ssh/known_hosts + chmod 644 ~/.ssh/known_hosts - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - run: npm install yarn -g @@ -30,11 +33,4 @@ jobs: yarn build - name: Deploy run: | - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) - eval $(ssh-agent -s) - cat $SSH_PRIVATE_KEY | tr -d '\r' | DISPLAY=None SSH_ASKPASS=~/.ssh/passphrase ssh-add - - mkdir -p ~/.ssh - chmod 700 ~/.ssh - ssh-keyscan $SERVER_IP >> ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts scp -r build/* root@$SERVER_IP:/var/www/html/fantasy.simoen.tech/_work/edd-APP/edd-APP/build