Skip to content

Commit d693329

Browse files
committed
add test for github actions
1 parent 7a7dd2c commit d693329

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/ssh-test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Per SSH im VPS einloggen und eine Datei erstellen
2+
run-name: ${{ github.actor }} testet stuff
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Code
12+
uses: actions/checkout@v4
13+
14+
- name: Setup SSH
15+
uses: webfactory/ssh-agent@v0.9.0
16+
with:
17+
ssh-private-key: ${{ secrets.VPS_SSH_KEY }}
18+
19+
- name: Erstelle Testdatei
20+
run: |
21+
ssh -o StrictHostKeyChecking=no ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} << 'EOF'
22+
cd /home/deployments/
23+
touch "Test Github Action - $(date)"
24+
ls
25+
EOF
26+
27+
28+
# - name: Copy Files to VPS
29+
# run: |
30+
# scp -o StrictHostKeyChecking=no -r . ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }}:${{ secrets.VPS_DOCKER_DIR }}
31+
#
32+
# - name: Rebuild & Restart Docker Container
33+
# run: |
34+
# ssh -o StrictHostKeyChecking=no ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} << 'EOF'
35+
# cd ${{ secrets.VPS_DOCKER_DIR }}
36+
# docker build -t larsw-homepage .
37+
# docker stop larsw-homepage || true
38+
# docker rm larsw-homepage || true
39+
# docker run -d --name larsw-homepage -p 80:3000 larsw-homepage
40+
# EOF

0 commit comments

Comments
 (0)