diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 063c447..b684099 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,11 +22,16 @@ jobs: - name: Launch self-hosted runners if: steps.list.outputs.modified != 'modified=[]' run: | + echo starting curl -sSL -X POST -H "X-Api-Key: $API_KEY" https://api.paperspace.io/machines/$MACHINE/start + echo started while test $(curl -fsSL -X GET -H "X-Api-Key: $API_KEY" https://api.paperspace.io/machines/getMachinePublic?machineId=$MACHINE | jq -r .state) != ready; do + echo sleeping sleep 5 done - IP=$(curl -fsSL -X GET -H "X-Api-Key: $API_KEY" $API_INFO?machineId=$MACHINE_ID | jq -r .publicIpAddress) + echo ready + IP=$(curl -fsSL -X GET -H "X-Api-Key: $API_KEY" https://api.paperspace.io/machines/getMachinePublic?machineId=$MACHINE | jq -r .publicIpAddress) + echo $IP echo "$SSH_KEY" > key ssh -o "StrictHostKeyChecking no" -i key paperspace@$IP 'touch "gha-run-${{ github.run_id }}.lock"' env: @@ -80,7 +85,7 @@ jobs: - uses: actions/checkout@v3 - name: Stop self-hosted runners run: | - IP=$(curl -fsSL -X GET -H "X-Api-Key: $API_KEY" $API_INFO?machineId=$MACHINE_ID | jq -r .publicIpAddress) + IP=$(curl -fsSL -X GET -H "X-Api-Key: $API_KEY" https://api.paperspace.io/machines/getMachinePublic?machineId=$MACHINE | jq -r .publicIpAddress) echo "$SSH_KEY" > key ssh -o "StrictHostKeyChecking no" -i key paperspace@$IP \ 'rm -f "gha-run-${{ github.run_id }}.lock"; sleep 10; ls gha-run-*.lock' || \