Files
tmc-test-task/.gitea/workflows/deploy-backend.yml
Oscar 978adb1eb5
Some checks failed
Deploy Backend / deploy (push) Failing after 33s
Deploy Frontend / deploy (push) Failing after 41s
upd
2026-06-04 15:17:46 +03:00

41 lines
1.1 KiB
YAML

name: Deploy Backend
on:
push:
branches:
- main
paths:
- '.gitea/workflows/deploy-backend.yml'
- 'backend/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Keyscan
run: |
ssh-keyscan git.koptilnya.xyz >> ~/.ssh/known_hosts
- 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