Files
tmc-test-task/.gitea/workflows/deploy-backend.yml
Workflow config file is invalid. Please check your config file: yaml: line 32: did not find expected key
Oscar 17cb1128a6
All checks were successful
Deploy Frontend / deploy (push) Successful in 40s
upd
2026-06-04 15:45:16 +03:00

46 lines
1.3 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 \
-e PATH_PREFIX=/test-1 \
--label "traefik.enable=true" \
--label "traefik.http.routers.tmc-backend.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" \
# --label "traefik.http.middlewares.tmc-backend-strip.stripprefix.prefixes=/test-1" \
tmc-backend:latest