Skip to content

Commit f61fca0

Browse files
authored
Create docker-build-and-run.yml
1 parent c293ced commit f61fca0

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "edge" ]
6+
7+
jobs:
8+
9+
build-and-run:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Login to Docker Hub
17+
uses: docker/login-action@v2
18+
with:
19+
username: staticaron
20+
password: ${{ secrets.DOCKER_PASSWORD }}
21+
22+
- name: Build the Docker image
23+
run: docker build -t staticaron/yui-bot:latest .
24+
25+
- name: Push the Image
26+
run: docker push staticaron/yui-bot:latest
27+
28+
- name: Log into the VPS
29+
uses: appleboy/ssh-action@v1.2.0
30+
with:
31+
host: ${{ secrets.VPS_HOST }}
32+
username: ${{ secrets.VPS_USERNAME }}
33+
key: ${{ secrets.VPS_KEY }}
34+
port: 22
35+
script: |
36+
docker pull staticaron/yui-bot:latest
37+
38+
docker stop yui-bot || true
39+
docker rm yui-bot || true
40+
41+
docker run --rm -d --name yui-bot staticaron/yui-bot:latest

0 commit comments

Comments
 (0)