Files
linearvoid/.gitea/workflows/cd.yml
T
zwitschi 3fbd0b7ba2
CD / deploy (push) Failing after 34s
CI / test (push) Failing after 55s
CI / docker (push) Skipped
CI / release (push) Skipped
switch CI/CD workflows to use GitHub-hosted runners
2026-08-02 18:19:02 +02:00

50 lines
1.4 KiB
YAML

name: CD
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deploy:
runs-on: [ubuntu-latest]
environment: production
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: git.allucanget.biz
username: ${{ secrets.GITEA_USERNAME }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Pull latest images
run: |
docker pull git.allucanget.biz/zwitschi/linearvoid/playout:latest || true
docker pull git.allucanget.biz/zwitschi/linearvoid/chat:latest || true
docker pull git.allucanget.biz/zwitschi/linearvoid/frontend:latest || true
docker pull git.allucanget.biz/zwitschi/linearvoid/nginx:latest || true
- name: Deploy with docker-compose
run: |
docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml up -d --remove-orphans
- name: Health check
run: |
sleep 10
curl -f http://localhost:8080/health || exit 1
curl -f http://localhost:3000/health || exit 1
curl -f http://localhost:8081/health || exit 1
- name: Cleanup old images
run: |
docker image prune -f --filter "until=24h"