Skip to content

Commit ef17331

Browse files
deploy script
1 parent dfc078a commit ef17331

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches: [main]
5+
workflow_dispatch:
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- uses: docker/login-action@v3
15+
with:
16+
username: ${{ secrets.DOCKERHUB_USERNAME }}
17+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
18+
19+
- uses: docker/build-push-action@v6
20+
with:
21+
context: .
22+
push: true
23+
tags: swiftfiddle/swiftfiddle-runner:latest
24+
25+
- uses: appleboy/[email protected]
26+
with:
27+
host: ${{ secrets.SSH_HOST }}
28+
username: ${{ secrets.SSH_USER }}
29+
key: ${{ secrets.SSH_KEY }}
30+
script: |
31+
docker pull swiftfiddle/swiftfiddle-runner:latest
32+
docker rename swiftfiddle-runner swiftfiddle-runner_
33+
docker stop swiftfiddle-runner_
34+
docker run -d --rm -p 80:8080 --name swiftfiddle-runner swiftfiddle/swiftfiddle-runner
35+
docker image prune -f

0 commit comments

Comments
 (0)