diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 25bba45..d08bda7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -25,10 +25,15 @@ jobs: docker-compose -f docker-compose.yml build docker-compose -f docker-compose.yml push - - name: Configure SSH - uses: webfactory/ssh-agent@v0.5.3 - with: - ssh-private-key: ${{ secrets.SSH_KEY }} + - name: Install sshpass + run: sudo apt-get install -y sshpass + + - name: Configure SSH key + run: | + mkdir -p ~/.ssh + echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan -t rsa ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts - name: Copy docker-compose.yml to server run: scp -o StrictHostKeyChecking=no -P ${{ secrets.SERVER_PORT }} docker-compose.yml ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}:${{ secrets.SERVER_PATH }}/docker-compose.yml