diff --git a/.github/workflows/scp-deploy.yml b/.github/workflows/scp-deploy.yml index 54691e56..f3c8e620 100644 --- a/.github/workflows/scp-deploy.yml +++ b/.github/workflows/scp-deploy.yml @@ -23,23 +23,25 @@ jobs: env: INTERNAL_USERNAME: ${{ secrets.JFROG_USERNAME }} INTERNAL_PASSWORD: ${{ secrets.JFROG_PASSWORD }} - - name: Setup SSH Keys and known_hosts + - name: Set up SSH key run: | - ssh-agent -a /tmp/ssh_agent.sock > /dev/null - ssh-add - <<< "${{ secrets.SCP_CERTIFICATE }}" + mkdir -p ~/.ssh + echo "${{ secrets.SCP_CERTIFICATE }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan -t rsa {{ secrets.SCP_HOST }} >> ~/.ssh/known_hosts - name: Deploy enrollment-server.war shell: bash run: | - scp -o 'StrictHostKeyChecking no' enrollment-server-wultra-*.war ${{ secrets.SCP_USERNAME }}@${{ secrets.SCP_HOST }}:/opt/apache-tomcat/webapps/enrollment-server.war + scp -o 'StrictHostKeyChecking no' -i ~/.ssh/id_rsa enrollment-server-wultra-*.war ${{ secrets.SCP_USERNAME }}@${{ secrets.SCP_HOST }}:/opt/apache-tomcat/webapps/enrollment-server.war - name: Deploy enrollment-server-onboarding.war shell: bash run: | - scp -o 'StrictHostKeyChecking no' enrollment-server-onboarding-wultra-*.war ${{ secrets.SCP_USERNAME }}@${{ secrets.SCP_HOST }}:/opt/apache-tomcat/webapps/enrollment-server-onboarding.war + scp -o 'StrictHostKeyChecking no' -i ~/.ssh/id_rsa enrollment-server-onboarding-wultra-*.war ${{ secrets.SCP_USERNAME }}@${{ secrets.SCP_HOST }}:/opt/apache-tomcat/webapps/enrollment-server-onboarding.war - name: Deploy enrollment-server.war mock shell: bash run: | - scp -o 'StrictHostKeyChecking no' enrollment-server-wultra-*.war ${{ secrets.SCP_USERNAME }}@${{ secrets.SCP_HOST }}:/opt/apache-tomcat/webapps/enrollment-server-mock.war + scp -o 'StrictHostKeyChecking no' -i ~/.ssh/id_rsa enrollment-server-wultra-*.war ${{ secrets.SCP_USERNAME }}@${{ secrets.SCP_HOST }}:/opt/apache-tomcat/webapps/enrollment-server-mock.war - name: Deploy enrollment-server-onboarding.war mock shell: bash run: | - scp -o 'StrictHostKeyChecking no' enrollment-server-onboarding-wultra-*.war ${{ secrets.SCP_USERNAME }}@${{ secrets.SCP_HOST }}:/opt/apache-tomcat/webapps/enrollment-server-onboarding-mock.war + scp -o 'StrictHostKeyChecking no' -i ~/.ssh/id_rsa enrollment-server-onboarding-wultra-*.war ${{ secrets.SCP_USERNAME }}@${{ secrets.SCP_HOST }}:/opt/apache-tomcat/webapps/enrollment-server-onboarding-mock.war