ci: fix deploy workflow - self-hosted runner + docker run with traefik labels
Some checks failed
Deploy / deploy (push) Failing after 0s

This commit is contained in:
Cosmo
2026-04-22 13:16:21 +00:00
parent fe2745f138
commit bc70f8b437

View File

@@ -1,4 +1,4 @@
name: Deploy to VM name: Deploy
on: on:
push: push:
@@ -6,14 +6,14 @@ on:
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: self-hosted
steps: steps:
- name: Pull latest code and rebuild - name: Build and restart
run: | run: |
cd /opt/digital-home/smart-home-tablet cd /opt/digital-home/smart-home-tablet
git pull origin main git pull origin main
sudo docker build -t smart-home-tablet:latest .
# Restart Coolify service (rebuild + restart) sudo docker stop tablet-yfh53kixpwkjlo4zibglx4n2 || true
curl -X POST 'https://coolify.digital-home.site/api/v1/services/yfh53kixpwkjlo4zibglx4n2/restart' -H 'Authorization: Bearer 4|8e75d9edfac009446b19abca1b9fdfadbe6da6b8f3efb0526520f0d2e3cfc266' -H 'Content-Type: application/json' || true sudo docker rm tablet-yfh53kixpwkjlo4zibglx4n2 || true
sudo docker run -d --name tablet-yfh53kixpwkjlo4zibglx4n2 --network coolify -p 3006:3000 --restart unless-stopped --label 'traefik.enable=true' --label 'traefik.http.routers.tablet.rule=Host(`tablet.digital-home.site`)' --label 'traefik.http.routers.tablet.entrypoints=https' --label 'traefik.http.routers.tablet.tls=true' --label 'traefik.http.routers.tablet.tls.certresolver=letsencrypt' --label 'traefik.http.services.tablet.loadbalancer.server.port=3000' -e HA_URL=http://192.168.31.110:8123 -e 'HA_TOKEN=' -e NEXT_PUBLIC_APP_URL=https://tablet.digital-home.site smart-home-tablet:latest
echo 'Deploy triggered' echo 'Done'