# GLYNT UI deployment pipeline
- [GLYNT UI deployment pipeline](#glynt-ui-deployment-pipeline)
- [Environments](#environments)
- [Deployment](#deployment)
- [Notes](#notes)
- [How to see the progress of a deployment on vercel](#how-to-see-the-progress-of-a-deployment-on-vercel)
## Environments
There are three publicly accessible environments:
| Environment | Public URL | Private Project URL | Git Branch |
|-------------|----------------------------------------------------|---------------------------------------------------------------------------|-------------------|
| sandbox | [ui-sandbox.glynt.ai](https://ui-sandbox.glynt.ai) | [glynt-ui-stage-sandbox](https://vercel.com/glynt/glynt-ui-stage-sandbox) | deploy/sandbox |
| stage | [ui-stage.glynt.ai](https://ui-stage.glynt.ai) | [glynt-ui-stage-sandbox](https://vercel.com/glynt/glynt-ui-stage-sandbox) | deploy/stage |
| production | [ui.glynt.ai](https://ui.glynt.ai) | [glynt-ui-production](https://vercel.com/glynt/glynt-ui-production) | deploy/production |
Due to Vercel limitations, our environments are divided into two projects.
## Deployment
The application deployment is divided into two parts:
- Application: Deploys the application to [Vercel](https://vercel.com/). A cloud platform for static sites and Serverless Functions.
- Infrastructure: Configures CloudFlare CNAMEs pointing from `glynt.ai` to Vercel's infrastructure.
To deploy the application in a web server, you will need to coordinate with an admin to make the required configurations in [Auth0](https://auth0.com/).
1. Create a new branch from `deploy/sandbox` this is the **development branch**
```bash
$ git checkout git@github.com:PaceWebApp/GlyntUI.git
$ git checkout deploy/sandbox
$ git checkout -b 3.XX.X
```
2. Push your changes and create a **pull request** to `deploy/sandbox`.
```bash
$ git commit -m "a new change"
$ git push origin HEAD
```
This will trigger a deploy of `deploy/sandbox` to [ui-sandbox.glynt.ai](https://ui-sandbox.glynt.ai)
3. Test your changes on the Vercel's live preview
Vercel will automatically deploy the PR code on a testing URL. It will available on the GitHub PR as a comment a couple of minutes later. You will be able to use it to confirm that the feature/fix was correctly implemented.

4. Request a code review
Add a teammate as a reviewer. Move to the next step after receiving approval of your PR.
5. Merge and squash the PR
```bash
$ Put here the corresponding commands <==================
$ Put here the corresponding commands <==================
$ Put here the corresponding commands <==================
$ Put here the corresponding commands <==================
```
6. Promote `deploy/sandbox` to `deploy/stage`:
```bash
$ git pull
$ git checkout deploy/sandbox
$ git push origin +deploy/sandbox:deploy/stage
```
This will trigger a deploy of `deploy/stage` to [ui-stage.glynt.ai](https://ui-stage.glynt.ai)
7. Promote `deploy/stage` to `deploy/production`.
```bash
$ git pull
$ git checkout deploy/stage
$ git push origin +deploy/stage:deploy/production
```
This will trigger a deploy of `deploy/production` to [ui.glynt.ai](https://ui.glynt.ai)
## Notes
### How to see the progress of a deployment on vercel
Open the [vercel dashboard](https://vercel.com/glynt/glynt-ui-production/deployments).