32 lines
723 B
YAML
32 lines
723 B
YAML
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)
|