Skip to content

Commit 7f4cb2a

Browse files
committed
update
Signed-off-by: appleboy <[email protected]>
1 parent a323c00 commit 7f4cb2a

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

.github/workflows/main.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,35 @@ jobs:
517517
PASS='3HUS$?8kLu)}'
518518
printf "PASS=${PASS}" >> $GITHUB_ENV
519519
520-
- name: Show Environment Variables
520+
- name: create new ssh server
521521
run: |
522-
echo $PASS
522+
docker run -d \
523+
--name=openssh-server \
524+
--hostname=openssh-server \
525+
-p 2222:2222 \
526+
-e SUDO_ACCESS=false \
527+
-e PASSWORD_ACCESS=true \
528+
-e USER_PASSWORD=${{ env.PASS }} \
529+
-e USER_NAME=linuxserver.io \
530+
--restart unless-stopped \
531+
lscr.io/linuxserver/openssh-server:latest
532+
docker exec openssh-server sh -c "hostname -i" > ip.txt
533+
echo "REMOTE_HOST<<EOF" >> $GITHUB_ENV
534+
cat ip.txt >> $GITHUB_ENV
535+
echo "EOF" >> $GITHUB_ENV
536+
echo "======= container ip address ========="
537+
cat ip.txt
538+
echo "======================================"
539+
sleep 2
540+
541+
- name: ssh by username and password
542+
uses: ./
543+
with:
544+
host: ${{ env.REMOTE_HOST }}
545+
username: linuxserver.io
546+
password: ${{ env.PASS }}
547+
port: 2222
548+
script: |
549+
#!/usr/bin/env bash
550+
set -e
551+
whoami

0 commit comments

Comments
 (0)