# Continuous Deployment

### How it works?

After the CI/CD pipeline builds and pushes the image to a container registry, the pipeline triggers the deployment on the platform. The platform automatically signals to the agent that it should pull and start the image with the tag that already exists on the node.

<figure><img src="https://315393028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCNvxW8k55ZlpJfMk8Oep%2Fuploads%2FYSM9bt46EpXY2I1sLBQd%2Fdyrector-io-continuous-deployment-workflow.png?alt=media&#x26;token=bbf2de99-ac36-4ef4-80ab-2685ed478ada" alt=""><figcaption></figcaption></figure>

### Generate CD token

**Step 1.** [**Create**](https://docs.dyrector.io/tutorials/create-your-product) a versioned project.

**Step 2.** Add a rolling version to the project.

**Step 3.** Add images to the version.

**Step 4.** [**Add**](https://docs.dyrector.io/tutorials/deploy-your-product) a deployment to the version.

**Step 5.** Click *Create* in the Deployment token card.

<figure><img src="https://315393028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCNvxW8k55ZlpJfMk8Oep%2Fuploads%2FFd4GvGziPZXE0ap6JLf3%2Fdyrector-io-cd-01.png?alt=media&#x26;token=a376fe90-5edd-49d6-9be1-4f73ee04ec25" alt=""><figcaption></figcaption></figure>

**Step 6.** Enter a name for your deployment token and set its expiration time, then click *Create*. You'll need to generate a new one when the token expires.

<figure><img src="https://315393028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCNvxW8k55ZlpJfMk8Oep%2Fuploads%2FUS9YLP80wJV5D9Tk02Vm%2Fdyrector-io-cd-02.png?alt=media&#x26;token=1602582b-3c3f-4cef-acc2-65bee3b6c8fd" alt=""><figcaption></figcaption></figure>

**Step 7.** Save the token somewhere secure as you won't be able to retrieve it later. Click *Close* when you're done.

<figure><img src="https://315393028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCNvxW8k55ZlpJfMk8Oep%2Fuploads%2FU3BBdmcYrfjSFSzNjRKy%2Fdyrector-io-cd-03.png?alt=media&#x26;token=d78ba057-1dec-43d9-8627-c3d19292be11" alt=""><figcaption></figcaption></figure>

**Step 8.** Paste the curl command into the pipeline.

{% hint style="danger" %}
**Never store your token in your git repository. Use pipeline secrets instead.**
{% endhint %}

#### How to revoke token?

You can revoke the token by clicking on the *Revoke token* button in the *Deployment token* card.

<figure><img src="https://315393028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCNvxW8k55ZlpJfMk8Oep%2Fuploads%2FsEU37E9lnTdBG99ZROuQ%2Fdyrector-io-cd-04.png?alt=media&#x26;token=73868476-890b-4d43-8b1d-d5d60a0dd259" alt=""><figcaption></figcaption></figure>
