> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dcdeploy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy from GitHub Repository

> Deploy your services directly from your GitHub repository with optional auto-build support.

<iframe src="https://app.supademo.com/embed/cmldi8oyt4tdwvhwzuc0uvow9" width="100%" height="500" allowFullScreen />

<Steps>
  <Step title="Navigate to Deploy tab">
    Navigate to the **Deploy** tab of the environment in your DCDeploy dashboard where you want to deploy your service.

    <img height="200" src="https://mintcdn.com/dcdeploy-9454b28e/pB_4WKNF_G09F_LI/docs/deploy/images/deploy.png?fit=max&auto=format&n=pB_4WKNF_G09F_LI&q=85&s=a7f60611746e34f17663c1c756fa5973" data-path="docs/deploy/images/deploy.png" />
  </Step>

  <Step title="Add a new service">
    Click on **Add Service**. A new form will appear where you can provide details of your service.
  </Step>

  <Step title="Fill in the details">
    <Tabs>
      <Tab title="Private repository">
        Complete the following fields:

        * **Service Name**: A unique name is auto-generated by default. You can change it if needed.
        * **Source**: Select **GitHub** as the source.

        <img height="200" src="https://mintcdn.com/dcdeploy-9454b28e/pB_4WKNF_G09F_LI/docs/deploy/images/gh-private-form.png?fit=max&auto=format&n=pB_4WKNF_G09F_LI&q=85&s=58972bcb719ddf24f019785470ccee4f" data-path="docs/deploy/images/gh-private-form.png" />

        * **Configure** github account, there are two way to Configuration

          * Click on user profile icon top right at navbar

                  <iframe src="https://app.supademo.com/embed/cmldiouh04u84vhwzbi0fopag" width="100%" height="500" allowFullScreen />

                  <img height="200" src="https://mintcdn.com/dcdeploy-9454b28e/PPFDUcmrmPTTWKMC/docs/deploy/images/user_profile.png?fit=max&auto=format&n=PPFDUcmrmPTTWKMC&q=85&s=afc3ae64f67957bf00f636a6bb2b1203" data-path="docs/deploy/images/user_profile.png" />

          * Click on profile option
          * navigate to **connection** tab

                  <img height="200" src="https://mintcdn.com/dcdeploy-9454b28e/pB_4WKNF_G09F_LI/docs/deploy/images/connection.png?fit=max&auto=format&n=pB_4WKNF_G09F_LI&q=85&s=25c96332d164e88c6daa19ddfaf20e68" data-path="docs/deploy/images/connection.png" />

          * and connect your github account\
            OR in your service form
          * Click on cog icon right side of the github

                  <img height="200" src="https://mintcdn.com/dcdeploy-9454b28e/pB_4WKNF_G09F_LI/docs/deploy/images/gh-private-form-cog.png?fit=max&auto=format&n=pB_4WKNF_G09F_LI&q=85&s=8c611b0f5636f774a54288bd5ad5ba5b" data-path="docs/deploy/images/gh-private-form-cog.png" />

          * Select the account you want to configure

                  <img height="200" src="https://mintcdn.com/dcdeploy-9454b28e/PPFDUcmrmPTTWKMC/docs/deploy/images/select-ghaccount.png?fit=max&auto=format&n=PPFDUcmrmPTTWKMC&q=85&s=a44b03b1c28ef143073fee841e0437d2" data-path="docs/deploy/images/select-ghaccount.png" />

          * Select the repository you want to deploy or allow all

                  <img height="200" src="https://mintcdn.com/dcdeploy-9454b28e/PPFDUcmrmPTTWKMC/docs/deploy/images/install.png?fit=max&auto=format&n=PPFDUcmrmPTTWKMC&q=85&s=41aea6124530441d293795fae2a42a26" data-path="docs/deploy/images/install.png" />

          * Click on install
        * **Repository**: Choose the GitHub repository you want to deploy

        <img height="200" src="https://mintcdn.com/dcdeploy-9454b28e/pB_4WKNF_G09F_LI/docs/deploy/images/private-repo.png?fit=max&auto=format&n=pB_4WKNF_G09F_LI&q=85&s=f63032c2b3ef8b7e682d3850a8ca2ad6" data-path="docs/deploy/images/private-repo.png" />
      </Tab>

      <Tab title="Public repository">
        Complete the following fields:

        * **Service Name**: A unique name is auto-generated by default. You can change it if needed.
        * **Source**: Select **GitHub** as the source.

        <img height="200" src="https://mintcdn.com/dcdeploy-9454b28e/pB_4WKNF_G09F_LI/docs/deploy/images/gh-public-form.png?fit=max&auto=format&n=pB_4WKNF_G09F_LI&q=85&s=619a54ea5dfe5c21584baa490334fdd9" data-path="docs/deploy/images/gh-public-form.png" />

        * **Repository**: Choose the GitHub repository where your code resides. Make sure your repository should be  **public** repositories.
      </Tab>
    </Tabs>
  </Step>

  <Step>
    * **Branch / Tag**: Select the branch or tag you want to deploy from.
    * **Build Context**: Provide the path in your repo where the Docker build should run (default is `./`).
    * **Dockerfile Path**: Specify the Dockerfile path if it’s not in the root directory (default is `./`).
    * **Auto Build (Optional)**: Enable auto-build to automatically trigger a new build whenever you push to the selected branch.
  </Step>

  <Step title="Configure runtime settings">
    Configure how your service should run:

    * **Port**: Enter the port number your service listens on. Ensure your app binds to `0.0.0.0` on this port.
    * **Protocol**: HTTPS is the default protocol.
    * **Region**: Select the DCDeploy region(s) where you want your service deployed.
    * **Machine Type**: Choose from available DCDeploy machine types (CPU, RAM, and Disk). [See details here](https://dcdeploy.com/pricing/).
    * **CPU/Memory Usage Limits**: Configure resource limits according to your service requirements.
    * **Environment Variables**: Provide environment variables directly paste your `.env` file or add manually.
    * **Scaling Options**:
      * Define minimum and maximum instances.
      * Enable **Auto Scaling** to automatically scale based on traffic or CPU/memory thresholds.
  </Step>

  <Step title="Deploy">
    Click the **Continue** button.

    <img height="200" src="https://mintcdn.com/dcdeploy-9454b28e/pB_4WKNF_G09F_LI/docs/deploy/images/summary.png?fit=max&auto=format&n=pB_4WKNF_G09F_LI&q=85&s=87ba5a0954ee94d2eeebd04a4ffd940f" data-path="docs/deploy/images/summary.png" />

    * You’ll be asked for confirmation before deployment.
    * If multiple services are added, removed, or updated, confirmation will cover all changes.

    <img height="200" src="https://mintcdn.com/dcdeploy-9454b28e/pB_4WKNF_G09F_LI/docs/deploy/images/confirm.png?fit=max&auto=format&n=pB_4WKNF_G09F_LI&q=85&s=8947c28d900e85e8cdca6d255e9f8ae4" data-path="docs/deploy/images/confirm.png" />
  </Step>
</Steps>
