dokku / github-action

MIT License
165 stars 30 forks source link

How to avoid Enter passphrase for /root/.ssh/id_rsa: ? #4

Closed kentuck13 closed 3 years ago

kentuck13 commented 3 years ago

settings:

jobs:
  deploy:
    name: Dokku deploy
    runs-on: ubuntu-latest

    needs: build

    steps:
      - name: Cloning repo
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Deploy to dokku
        uses: dokku/github-action@0.0.11
        with:
          branch: 'develop'
          git_push_flags: '--force'
          ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
          git_remote_url: 'ssh://dokku@remote_ip:22/my_app_name'

log:

/usr/bin/docker run --name cc4956a543104901e24d5c8e935cfa69247b6c_d2f5f6 --label cc4956 --workdir /github/workspace --rm -e INPUT_BRANCH -e INPUT_GIT_PUSH_FLAGS -e INPUT_SSH_PRIVATE_KEY -e INPUT_GIT_REMOTE_URL -e INPUT_CI_BRANCH_NAME -e INPUT_CI_COMMIT -e INPUT_COMMAND -e INPUT_REVIEW_APP_NAME -e INPUT_SSH_HOST_KEY -e BRANCH -e CI_BRANCH_NAME -e CI_COMMIT -e COMMAND -e GIT_PUSH_FLAGS -e GIT_REMOTE_URL -e REVIEW_APP_NAME -e SSH_HOST_KEY -e SSH_PRIVATE_KEY -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true --entrypoint "/bin/dokku-deploy" -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/myapp-backend/myapp-backend":"/github/workspace" cc4956:a543104901e24d5c8e935cfa69247b6c
10

11
\u001b[32mSetting up SSH Key\u001b[0m
12

13
\u001b[32mGenerating SSH_HOST_KEY from ssh-keyscan against my_app_ip:22\u001b[0m
14
# my_app_ip:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.1
15
# my_app_ip:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.1
16
# my_app_ip:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.1
17
# my_app_ip:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.1
18
# my_app_ip:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.1
19

20
\u001b[32mAdding SSH Key to ssh-agent\u001b[0m
21
Agent pid 24
22
Enter passphrase for /root/.ssh/id_rsa: 
josegonzalez commented 3 years ago

You need to generate an ssh key that doesn't have a password associated with it.

See here to check if it does: https://security.stackexchange.com/a/129727/148496

kentuck13 commented 3 years ago

@josegonzalez Thank you!