diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 4979b86..e6c1a77 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -29,3 +29,13 @@ jobs: - name: Build Docker image run: docker build -t fastapi-demo:latest . + + - name: Deploy application + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: | + docker rm -f fastapi-demo || true + docker run -d \ + --name fastapi-demo \ + --restart unless-stopped \ + -p 127.0.0.1:8000:8000 \ + fastapi-demo:latest