Skip to content

Commit

Permalink
das-237: Use ssh command
Browse files Browse the repository at this point in the history
  • Loading branch information
levisingularity committed Mar 5, 2025
1 parent d46d583 commit a4da286
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions .github/workflows/publish-das-components-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Copy script to server
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
source: "src/scripts/refrash-nunet-deployment.sh"
target: "/tmp/refrash-nunet-deployment.sh"
- name: Copy script to server using SCP
run: |
echo "Copying script to server..."
scp -i ${{ secrets.SSH_PRIVATE_KEY }} -o StrictHostKeyChecking=no src/scripts/refresh-nunet-deployment.sh ${{ secrets.SSH_USER }}@${{ secrets.SERVER_HOST }}:/tmp/refresh-nunet-deployment.sh
- name: Load ensemble.yaml content into a variable
id: load_ensemble
Expand All @@ -79,13 +75,11 @@ jobs:
echo "ensemble.yaml content loaded successfully."
- name: Process ensemble.yaml and execute deployment script on remote server
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
PEER_ID=$(nunet actor cmd /dms/node/peers/self -c "$USER_NAME" | jq -r '.id')
run: |
echo "Running deployment script on the remote server..."
ssh -i ${{ secrets.SSH_PRIVATE_KEY }} -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SERVER_HOST }} << 'EOF'
PEER_ID=$(nunet actor cmd /dms/node/peers/self -c $USER_NAME | jq -r '.id')
if [ -z "$PEER_ID" ]; then
echo "Error: Could not get the peer ID"
exit 1
Expand All @@ -96,3 +90,4 @@ jobs:
echo "${{env.ENSEMBLE_CONTENT}}" | sed "s#\${PEER_ID}#$PEER_ID#g" > $ENSEMBLE_FILE
bash +x /tmp/refresh-nunet-deployment.sh $ENSEMBLE_FILE
EOF

0 comments on commit a4da286

Please sign in to comment.