# Build & Deploy

Follow the instructions [here](https://docs.digit.org/digit-ui/build/broken-reference) 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 whole UI module must be rebuilt and redeployed.\
`frontend/micro-ui/digit-ui/`

<img src="https://2796820426-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqv3BfwsgDlxxZoSTquMs%2Fuploads%2FYhXRqC4ueJaK036Cj9Sl%2Fimage.png?alt=media&#x26;token=e09c2351-119f-4d48-a3d8-110977d498f3" 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://2796820426-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqv3BfwsgDlxxZoSTquMs%2Fuploads%2FJ1rNTkIGKvKyz0OvFNSn%2Fimage.png?alt=media&#x26;token=cf02e145-4b81-4ba0-a5ea-0fd8f6062686" 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://2796820426-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqv3BfwsgDlxxZoSTquMs%2Fuploads%2FwSyuWRYCuJHl4e6r2Yhh%2Fimage.png?alt=media&#x26;token=b5b53e65-8d03-48ba-b74d-8d3bfbb9945b" alt="" data-size="original">

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

* Navigate to GitHub Actions\
  ![](https://2796820426-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqv3BfwsgDlxxZoSTquMs%2Fuploads%2Fh4RmG0qpULKLcmsgh6Dl%2Fimage.png?alt=media\&token=e6448719-a72c-4dda-9164-61801884ae64)
* Click on build pipeline\
  ![](https://2796820426-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqv3BfwsgDlxxZoSTquMs%2Fuploads%2FhSGdkeWFL1si9O4VQyPD%2Fimage.png?alt=media\&token=e7c4c189-9875-4bbf-a066-7ca5f6a34f61)
* Click on the Run workflow dropdown\
  ![](https://2796820426-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqv3BfwsgDlxxZoSTquMs%2Fuploads%2FxGQXtKcWbryXV2qaXHPo%2Fimage.png?alt=media\&token=e6d7d376-e8c1-49b9-916c-6cce9e122b0a)
* 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.

<mark style="background-color:$warning;">Note: Make sure the "build.yaml" file is available under the .github/workflows folder.</mark>

</details>

<details>

<summary>Deploy</summary>

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

<img src="https://2796820426-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqv3BfwsgDlxxZoSTquMs%2Fuploads%2FNwbdnDV6MHjeIHLKK7fB%2Fimage.png?alt=media&#x26;token=95e1e220-f331-40d0-9a0d-197dc92347c7" alt="" data-size="original">

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

<img src="https://2796820426-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqv3BfwsgDlxxZoSTquMs%2Fuploads%2F5vtqWv6uvJYhvbjJsEtI%2Fimage.png?alt=media&#x26;token=812753ad-7008-4ccf-8cc2-cb617aedba72" alt="" data-size="original">

</details>
