# Build & Deploy

Follow the instructions [here](https://docs.digit.org/platform/guides/developer-guide/backend-developer-guide/section-7-build-and-deploy-instructions) to set up the job pipeline. Ignore the steps not applicable to the frontend.

{% hint style="info" %}
Instructions here are provided assuming CD/CI has been set up using the DIGIT ci-as-code module.
{% endhint %}

<details>

<summary>Build </summary>

Method - 1 (Through Jenkins):\
Go to the Jenkins build page. Click on digit-ui under the folder path mentioned below. The entire UI module is built as a monolith. Since this module is also part of the same monolith, the entire UI module has to be built and redeployed.\
`frontend/micro-ui/digit-ui/`

<img src="https://3868804918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FegsIWleSdyH9rMLJ8ShI%2Fuploads%2Fgit-blob-aebb6fea68c171b9ca954ca128c5e2d09669b7f0%2Fimage.png?alt=media" alt="" data-size="original">

Click on `Build with parameter`. Select the feature branch name by searching for it in the search box on the right side of the screen. Click on Build.

<img src="https://3868804918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FegsIWleSdyH9rMLJ8ShI%2Fuploads%2Fgit-blob-88bb0ae3bdd91dc1fdb703181f10003dc6636985%2Fimage.png?alt=media" alt="" data-size="original">

Once the build is successful, open the console output and find the Docker image that has been built. Copy the Docker image ID.

<img src="https://3868804918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FegsIWleSdyH9rMLJ8ShI%2Fuploads%2Fgit-blob-fdc7e0ba1e21c845d765ec151b84a99aa62c9056%2Fimage.png?alt=media" alt="" data-size="original">

**Method - 2(Recommended through Github actions) :**&#x20;

* Navigate to GitHub Actions\
  ![](https://3868804918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FegsIWleSdyH9rMLJ8ShI%2Fuploads%2FBtfAJytmk2jM039J0xZ9%2Fimage.png?alt=media\&token=02c3e00a-55b6-4240-ba8c-35df16398f60)
* Click on build pipeline\
  ![](https://3868804918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FegsIWleSdyH9rMLJ8ShI%2Fuploads%2FgUxf96J5DwvS02bsCxYw%2Fimage.png?alt=media\&token=eb0282ab-d4a8-47aa-ab7a-f9aed5ffe209)
* Click on the Run workflow dropdown\
  ![](https://3868804918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FegsIWleSdyH9rMLJ8ShI%2Fuploads%2FVGjuJy1hRcT7ReiX8oQ4%2Fimage.png?alt=media\&token=6c8bbdbe-b65f-4e91-bfdd-fba65fc38bcf)
* Select the branch name and module from the dropdown and hit the Run workflow button
* Once the build is successful, copy the build image name from the summary.

*Note: Make sure the "build.yaml" file is available under the .github/workflows folder.*

</details>

<details>

<summary>Deploy</summary>

Link:- <https://builds.companyname.org/job/deployments/job/deploy-to-dev/build?delay=0sec>

<img src="https://3868804918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FegsIWleSdyH9rMLJ8ShI%2Fuploads%2Fgit-blob-72af1f7164c59eb991fffa656741bb74540c6d25%2Fimage.png?alt=media" alt="" data-size="original">

Copy the Docker image IDs from the previous step and paste them in the above box. Click on "Build". Once the image is deployed, you will see a message as shown below:

<img src="https://3868804918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FegsIWleSdyH9rMLJ8ShI%2Fuploads%2Fgit-blob-956b036403c0f04c9a475a43bd09d42afe7f702d%2Fimage.png?alt=media" alt="" data-size="original">

</details>
