name: deploy on: workflow_dispatch: jobs: deploy: runs-on: runner steps: - name: Deploy via SSH env: DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} DEPLOY_USER: ${{ secrets.DEPLOY_USER }} DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }} run: | echo "Deploying..." set -euo pipefail install -m 700 -d ~/.ssh echo "${DEPLOY_SSH_KEY}" > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 echo "Connecting to ${DEPLOY_USER}@${DEPLOY_HOST}" echo "Navigating to ${DEPLOY_PATH} and pulling latest changes" ssh -o StrictHostKeyChecking=no "${DEPLOY_USER}@${DEPLOY_HOST}" \ "cd '${DEPLOY_PATH}' && git pull && ./new_version.sh"