# CI & CD pipelines
All pipeline are located: 
https://github.com/sky-distribution/policy-service/tree/development/.github/workflows

## CI - main.yaml
### Pipeline path:
https://github.com/sky-distribution/policy-service/blob/development/.github/workflows/main.yml

### Triggers:
- Every PUSH operations

### Input parameters:
NO INPUTS

### Steps:
1. TEST        - npm build & test, sonarcloud checks quality of the code
2. DEPLOY_DEV  - (ONLY IF push to default branch) Trigger pipeline to build and deploy to DEV-1, DEV-2 DEV-3, DEV-4

## digital beesafe cicd
Pipeline to build and deployment single service (policy-service) from one repository policy-service.

### Pipeline path
https://github.com/sky-distribution/policy-service/blob/development/.github/workflows/digital-cicd.yml

#### Triggers
- Manual trigger

#### Input parameters
| Input Parameter| Description                       | Default                      |
|:--------------:|:---------------------------------:|:----------------------------:|
| `branch_name`  | Branch name to build and deploy policy-service       | development  (default branch)|
| `target`       | Target environment (uat-1 / dev-4 / prod-green)      | null                   |
| `acr_tag_name` | If you want to deploy services based on EXISTING image (check Azure Contariner Registry and place image tag name)     | null                    |


#### Steps
1. annotations                    - collect inputs with other information and output them to workflow run:
2. create-runner                  - Create temporary self hosted runner (via DevOps repository)
3. trigger_ci_cd_devops_pipeline  - Trigger pipeline to build and deployment single (beackend-epayment OR beackend-epayment-benefia) service, pipeline to build&deployment service is in the DevOps repositry
4. Create Github Release          - tag name: release_${{ env.target }}_${{ env.datestamp }}

AD. 1. Annotation Details:
![image](https://user-images.githubusercontent.com/72020603/152360697-0f3d3e66-28d1-4b75-8b2a-6fcb150ec521.png)
