This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
name: Build & Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build image
|
||||
run: docker build -t 3d-pricing:latest .
|
||||
|
||||
- name: Redeploy
|
||||
run: |
|
||||
docker rm -f 3d-pricing 2>/dev/null || true
|
||||
docker run -d \
|
||||
--name 3d-pricing \
|
||||
--restart unless-stopped \
|
||||
-p 5010:5000 \
|
||||
-v /opt/3d-pricing-data:/data \
|
||||
-e DATABASE_PATH=/data/pricing.db \
|
||||
3d-pricing:latest
|
||||
|
||||
- name: Healthcheck
|
||||
run: |
|
||||
sleep 5
|
||||
curl -f http://localhost:5010/ || (echo "App not responding!" && exit 1)
|
||||
Reference in New Issue
Block a user