Skip to content

Commit 581262f

Browse files
author
colinlyguo
committed
fix
1 parent 397b637 commit 581262f

File tree

2 files changed

+52
-18
lines changed

2 files changed

+52
-18
lines changed

.github/workflows/common.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,33 @@ jobs:
4242
uses: Swatinem/rust-cache@v2
4343
with:
4444
workspaces: "common/libzkp/impl -> target"
45-
- name: Combine all deploy keys
45+
- name: Setup SSH for private repositories
4646
run: |
47-
echo "${{ secrets.OPENVM_GPU_SSH_PRIVATE_KEY }}" > key1
48-
echo "${{ secrets.OPENVM_STARK_GPU_SSH_PRIVATE_KEY }}" > key2
49-
echo "${{ secrets.PLONKY3_GPU_SSH_PRIVATE_KEY }}" > key3
50-
cat key1 key2 key3 > all_keys
51-
chmod 600 all_keys
52-
- name: Setup SSH Agent
53-
uses: webfactory/[email protected]
54-
with:
55-
ssh-private-key: ${{ steps.setup-keys.outputs.keys }}
56-
env:
57-
SSH_PRIVATE_KEY: ${{ secrets.OPENVM_GPU_SSH_PRIVATE_KEY }} # just for syntax correctness
47+
mkdir -p ~/.ssh
48+
chmod 700 ~/.ssh
49+
50+
cat > ~/.ssh/id_rsa_1 << 'EOL'
51+
${{ secrets.OPENVM_GPU_SSH_PRIVATE_KEY }}
52+
EOL
53+
54+
cat > ~/.ssh/id_rsa_2 << 'EOL'
55+
${{ secrets.OPENVM_STARK_GPU_SSH_PRIVATE_KEY }}
56+
EOL
57+
58+
cat > ~/.ssh/id_rsa_3 << 'EOL'
59+
${{ secrets.PLONKY3_GPU_SSH_PRIVATE_KEY }}
60+
EOL
61+
62+
chmod 600 ~/.ssh/id_rsa_*
63+
64+
eval "$(ssh-agent -s)" > /dev/null
65+
ssh-add ~/.ssh/id_rsa_1 2>/dev/null
66+
ssh-add ~/.ssh/id_rsa_2 2>/dev/null
67+
ssh-add ~/.ssh/id_rsa_3 2>/dev/null
68+
69+
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts 2>/dev/null
70+
71+
echo "Number of loaded keys: $(ssh-add -l | wc -l)"
5872
- name: Lint
5973
working-directory: 'common'
6074
run: |

.github/workflows/docker.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,33 @@ jobs:
307307
REPOSITORY: coordinator-api
308308
run: |
309309
aws --region ${{ env.AWS_REGION }} ecr describe-repositories --repository-names ${{ env.REPOSITORY }} && : || aws --region ${{ env.AWS_REGION }} ecr create-repository --repository-name ${{ env.REPOSITORY }}
310-
- name: Combine all deploy keys
310+
- name: Setup SSH for private repositories
311311
run: |
312-
echo "${{ secrets.OPENVM_GPU_SSH_PRIVATE_KEY }}" > key1
313-
echo "${{ secrets.OPENVM_STARK_GPU_SSH_PRIVATE_KEY }}" > key2
314-
echo "${{ secrets.PLONKY3_GPU_SSH_PRIVATE_KEY }}" > key3
315-
cat key1 key2 key3 > all_keys
316-
chmod 600 all_keys
312+
mkdir -p ~/.ssh
313+
chmod 700 ~/.ssh
314+
315+
cat > ~/.ssh/id_rsa_1 << 'EOL'
316+
${{ secrets.OPENVM_GPU_SSH_PRIVATE_KEY }}
317+
EOL
318+
319+
cat > ~/.ssh/id_rsa_2 << 'EOL'
320+
${{ secrets.OPENVM_STARK_GPU_SSH_PRIVATE_KEY }}
321+
EOL
322+
323+
cat > ~/.ssh/id_rsa_3 << 'EOL'
324+
${{ secrets.PLONKY3_GPU_SSH_PRIVATE_KEY }}
325+
EOL
326+
327+
chmod 600 ~/.ssh/id_rsa_*
328+
329+
eval "$(ssh-agent -s)" > /dev/null
330+
ssh-add ~/.ssh/id_rsa_1 2>/dev/null
331+
ssh-add ~/.ssh/id_rsa_2 2>/dev/null
332+
ssh-add ~/.ssh/id_rsa_3 2>/dev/null
333+
334+
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts 2>/dev/null
335+
336+
echo "Number of loaded keys: $(ssh-add -l | wc -l)"
317337
- name: Setup SSH Agent
318338
uses: webfactory/[email protected]
319339
with:

0 commit comments

Comments
 (0)