Skip to content

Commit

Permalink
ci: enhance CI workflow with SSH command execution
Browse files Browse the repository at this point in the history
- Add `PUBLIC_KEY` secret to the workflow
- Remove commented-out test command
- Add step to execute remote SSH commands using `appleboy/[email protected]`

Signed-off-by: Bo-Yi Wu <[email protected]>
  • Loading branch information
appleboy committed Jun 6, 2024
1 parent 24a0285 commit dfc4b57
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/test2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
PASSWORD_ACCESS: true
USER_PASSWORD: password
USER_NAME: linuxserver.io
PUBLIC_KEY: ${{ secrets.PUBLIC_KEY }}

steps:
- name: Checkout code
Expand All @@ -85,8 +86,6 @@ jobs:
run: |
SSHD_IP=${{ steps.sshd.outputs.sshd_ip }}
echo "SSHD IP: $SSHD_IP"
# 在這裡運行你的測試命令,並使用獲取到的 IP 地址
echo "Running tests..."
- name: executing remote ssh commands using password (1.0.3)
uses: appleboy/[email protected]
Expand All @@ -97,3 +96,13 @@ jobs:
password: password
port: 2222
script: whoami

- name: executing remote ssh commands using password (1.0.3)
uses: appleboy/[email protected]
if: always()
with:
host: ${{ steps.sshd.outputs.sshd_ip }}
username: linuxserver.io
key: ${{ env.PRIVATE_KEY }}
port: 2222
script: whoami

0 comments on commit dfc4b57

Please sign in to comment.