-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSample-call-release-and-deploy-workflow.yaml
More file actions
67 lines (66 loc) · 3.1 KB
/
Sample-call-release-and-deploy-workflow.yaml
File metadata and controls
67 lines (66 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# This is a sample template for calling a reusable workflow from NEDSS-Workflows public repository (Release-microservice-container.yaml)
# Manually trigger a build on your branch of choice
# The workflow either tags an existing container (typically for promotion to higher environments) or builds and stores a new container
# In addition it can update the input helm values file through a pull request, if desired
#
# Manual variable edits.
# Edit:
# 1. <microservice_name>
# 2. <dockerfile_relative_path> to correctly identify your microservice and dockerfile path
# 3. <environment_classifier>
# 4. <update_helm_chart>
# 5. <values_file_with_path>
name: Release <microservice_name> package
on:
workflow_dispatch:
inputs:
existing-image-tag:
description: 'Image tag of existing container in ECR (not used if build-new-container=true).'
required: false
type: string
build-new-container:
description: 'Check the box to create a new container tagged with new-image-tag.'
required: true
default: false
type: boolean
environment_classifier:
description: Metadata to append to application version. Ex. if version=1.0.0, and environment_classifier=SNAPSHOT result will be 1.0.0-SNAPSHOT.<githubsha>.
required: true
type: string
update_helm_chart:
description: (true or false) Should the image tag be updated? If true, specify a value for values_file_with_path. Default=false.
required: true
type: boolean
default: false
values_file_with_path:
description: What is the path to the helm chart in NBS helm chart repository? (ex. charts/elasticsearch)
type: string
default: ""
jobs:
call-build-microservice-container-workflow:
uses: CDCgov/NEDSS-Workflows/.github/workflows/Build-other-microservice-container.yaml@main
with:
microservice_name: <microservice_name>
dockerfile_relative_path: <dockerfile_relative_path>
existing-image-tag: ${{inputs.existing-image-tag}}
build-new-container: ${{inputs.build-new-container}}
environment_classifier: ${{inputs.environment_classifier}}
update_helm_chart: ${{inputs.update_helm_chart}}
values_file_with_path: ${{inputs.values_file_with_path}}
secrets:
CDC_NBS_SANDBOX_SHARED_SERVICES_ACCOUNTID: ${{secrets.CDC_NBS_SANDBOX_SHARED_SERVICES_ACCOUNTID}}
ECR_REPO_BASE_NAME: ${{secrets.ECR_REPO_BASE_NAME}}
GIT_USER_EMAIL: ${{secrets.GIT_USER_EMAIL}}
GIT_USER_NAME: ${{secrets.GIT_USER_NAME}}
HELM_TOKEN: ${{secrets.HELM_TOKEN}}
call-update-helm:
needs: call-build-microservice-container-workflow
uses: CDCgov/NEDSS-Workflows/.github/workflows/Update-helm-charts.yaml@main
with:
microservice_name: <microservice_name>
values_file_with_path: ${{inputs.values_file_with_path}}
new_image_tag: ${{ needs.call-build-microservice-container-workflow.outputs.output_image_tag }}
secrets:
GIT_USER_EMAIL: ${{secrets.GIT_USER_EMAIL}}
GIT_USER_NAME: ${{secrets.GIT_USER_NAME}}
HELM_TOKEN: ${{secrets.HELM_TOKEN}}