---
title: "Deploy on git push (Gyro Pipeline)"
description: "Connect a repository: every push builds the Dockerfile and rolls the service out without downtime."
url: https://www.gyrohosting.com/developers/en/howto/container-pipeline.html
language: en
openapi: https://www.gyrohosting.com/developers/openapi.json
api_version: 2.30.0
---

# Deploy on git push (Gyro Pipeline)

Connect a repository: every push builds the Dockerfile and rolls the service out without downtime.

**curl**

```bash
curl -s -X POST https://www.gyrohosting.com/api/v1/client/cloud/containers/12345/pipelines \
  -H "Authorization: Bearer $GYRO_TOKEN" -H "Content-Type: application/json" \
  -d '{"name":"web","provider":"github","repo":"https://github.com/gyro-ornek/uygulama","branch":"main","auto":true,"image":"web","targets":["web"]}'
```

**CLI**

```bash
gyro container pipeline create 12345 --name web --provider github --repo https://github.com/gyro-ornek/uygulama --branch main --auto --image web --targets web
```

**Terraform**

```hcl
resource "gyro_container_pipeline" "web" {
  service_id = 12345
  name       = "web"
  repo       = "https://github.com/gyro-ornek/uygulama"
  branch     = "main"
  image      = "web"
  targets    = ["web"]
}
output "webhook_url" { value = gyro_container_pipeline.web.webhook_url }
```

Add `webhook_url` and `webhook_secret` from the answer to the repository webhook (GitHub: *application/json*, push event). Private repository: send a read-only `token`, or use an SSH address with a deploy key. Without a repository: `"provider":"archive"` and upload an archive.


## Start a run by hand and follow it

**curl**

```bash
curl -s -X POST https://www.gyrohosting.com/api/v1/client/cloud/containers/12345/pipelines/7/runs -H "Authorization: Bearer $GYRO_TOKEN" -H "Content-Type: application/json" -d '{}'
curl -s https://www.gyrohosting.com/api/v1/client/cloud/containers/12345/pipeline-runs/42/logs -H "Authorization: Bearer $GYRO_TOKEN"
```

**CLI**

```bash
gyro container pipeline run 12345 7
gyro container pipeline run-get 12345 42
```

Multi-stage Dockerfile: `build_target` (`--target`). Unhealthy new version: `auto_rollback` returns to the previous one.
