Skip to content

Commit 860ea1c

Browse files
Create deploy.yml (#6)
1 parent ff5f6f4 commit 860ea1c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy to Jelastic
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Deploy via SSH to Jelastic
17+
uses: appleboy/ssh-action@v1.0.3
18+
with:
19+
host: ${{ secrets.JELASTIC_HOST }}
20+
username: ${{ secrets.JELASTIC_USER }}
21+
key: ${{ secrets.JELASTIC_SSH_KEY }}
22+
port: ${{ secrets.JELASTIC_PORT }}
23+
script: |
24+
cd /opt/bl-app
25+
git pull origin main
26+
docker build -t biography-library .
27+
docker stop bl-app || true
28+
docker rm bl-app || true
29+
docker run -d \
30+
--name bl-app \
31+
--restart unless-stopped \
32+
-p 3000:3000 \
33+
--env-file .env \
34+
biography-library
35+
docker image prune -f
36+
echo "Deploy completato: $(date)"

0 commit comments

Comments
 (0)