This commit is contained in:
Oscar
2026-06-04 15:10:23 +03:00
parent 42e675328f
commit ce8cc6510f
7 changed files with 364 additions and 285 deletions

View File

@@ -0,0 +1,36 @@
name: Deploy Backend
on:
push:
branches:
- master
paths:
- '.gitea/workflows/deploy-backend.yml'
- 'backend/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build image
run: docker build -t tmc-backend ./backend
- name: Stop old container
run: docker rm -f tmc-backend || true
- name: Run
run: |
docker run -d \
--name tmc-backend \
--network traefik \
--label "traefik.enable=true" \
--label "traefik.http.routers.tmc-backend.rule=Host(\`${{ vars.BACKEND_HOST }}\`)" \
--label "traefik.http.routers.tmc-backend.entrypoints=websecure" \
--label "traefik.http.routers.tmc-backend.tls=true" \
--label "traefik.http.routers.tmc-backend.tls.certresolver=myresolver" \
--label "traefik.http.services.tmc-backend.loadbalancer.server.port=1337" \
tmc-backend:latest