Files
tmc-test-task/.gitea/workflows/deploy-backend.yml
Oscar 70f692b7d8
Some checks failed
Deploy Backend / deploy (push) Successful in 22s
Deploy Frontend / deploy (push) Has been cancelled
upd
2026-06-04 15:30:24 +03:00

44 lines
1.2 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
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-strict: false
persist-credentials: false
- 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.chad-server.rule=Host(\`api.koptilnya.xyz\`) && PathPrefix(\`/test-1\`)" \
--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" \
tmc-backend:latest