Last active
August 25, 2023 13:00
-
-
Save mpdude/9cf8181a4adebda0c30b555b41692b18 to your computer and use it in GitHub Desktop.
Setup a SSH deploy key so that workflow steps can fetch dependencies from private GitHub repos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/my-workflow.yml | |
# ... other config here | |
jobs: | |
build: | |
runs-on: ubuntu-18.04 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Setup SSH Keys and known_hosts | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: | | |
mkdir -p ~/.ssh | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null | |
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" | |
- name: Some task that fetches dependencies | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: ./fetch-deps.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment