Skip to content

Commit 206573e

Browse files
committed
chore: move github workflow to root folder
1 parent 2948cbf commit 206573e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/hetzner.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish to Hetzner
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "apps/meshjs-rag/**"
9+
10+
11+
jobs:
12+
publish_images:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: checkout
16+
uses: actions/checkout@v4
17+
18+
- name: build image
19+
run: docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/meshai-backend:latest .
20+
21+
- name: push image to the docker hub
22+
run: |
23+
echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
24+
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/meshai-backend:latest
25+
26+
- name: Deploy to Hetzner via SSH
27+
uses: appleboy/[email protected]
28+
with:
29+
host: ${{ secrets.HETZNER_HOST }}
30+
username: ${{ secrets.HETZNER_USERNAME }}
31+
key: ${{ secrets.SSH_PRIVATE_KEY }}
32+
script: |
33+
docker pull ${{ secrets.DOCKER_HUB_USERNAME }}/meshai-backend:latest
34+
docker stop meshai-backend || true
35+
docker rm meshai-backend || true
36+
docker run -d --name meshai-backend --env-file ./.env --restart always -p 127.0.0.1:8000:8000 ${{ secrets.DOCKER_HUB_USERNAME }}/meshai-backend:latest

0 commit comments

Comments
 (0)