-
Notifications
You must be signed in to change notification settings - Fork 15
137 lines (112 loc) · 5.95 KB
/
deploy-test.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Deploy Test
env:
IMAGE_TAG: ${{ inputs.IS_HOTFIX == 'true' && format('hotfix-{0}-{1}', vars.PATCH_BRANCH, vars.HOTFIX_TAG) || github.ref_name }}
on:
release:
types: [prereleased]
workflow_dispatch:
inputs:
IS_HOTFIX:
description: 'Is this a hotfix?'
required: false
default: 'false'
jobs:
call-lambda-zip:
uses: ./.github/workflows/lambda-zip.yml
secrets: inherit
with:
ENVIRONMENT: TEST
REGISTRY: ${{ vars.REGISTRY }}
tag-images:
runs-on: ubuntu-22.04
environment: TEST
env:
branch-name: ${{ github.event_name == 'release' && github.event.release.target_commitish || github.ref_name }}
outputs:
tag-value: ${{ steps.get-release-tag.outputs.tag-value }}
steps:
- uses: actions/checkout@v3
if: ${{ inputs.IS_HOTFIX != 'true' }}
- uses: actions/checkout@v3
if: ${{ inputs.IS_HOTFIX == 'true' }}
with:
ref: ${{ inputs.BRANCH }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ vars.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag client image
run: |
docker pull ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.CLIENT_IMAGE }}:${{ env.branch-name }}
docker tag ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.CLIENT_IMAGE }}:${{ env.branch-name }} ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.CLIENT_IMAGE }}:${{ env.IMAGE_TAG }}
docker push ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.CLIENT_IMAGE }}:${{ env.IMAGE_TAG }}
- name: Tag server image
run: |
docker pull ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.SERVER_IMAGE }}:${{ env.branch-name }}
docker tag ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.SERVER_IMAGE }}:${{ env.branch-name }} ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.SERVER_IMAGE }}:${{ env.IMAGE_TAG }}
docker push ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.SERVER_IMAGE }}:${{ env.IMAGE_TAG }}
- name: Tag liquibase image
run: |
docker pull ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.LIQUIBASE_IMAGE }}:${{ env.branch-name }}
docker tag ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.LIQUIBASE_IMAGE }}:${{ env.branch-name }} ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.LIQUIBASE_IMAGE }}:${{ env.IMAGE_TAG }}
docker push ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.LIQUIBASE_IMAGE }}:${{ env.IMAGE_TAG }}
- name: Tag nginx image
run: |
docker pull ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.NGINX_IMAGE }}:${{ env.branch-name }}
docker tag ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.NGINX_IMAGE }}:${{ env.branch-name }} ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.NGINX_IMAGE }}:${{ env.IMAGE_TAG }}
docker push ${{vars.REGISTRY}}/${{github.repository_owner}}/${{ vars.NGINX_IMAGE }}:${{ env.IMAGE_TAG }}
- name: Tag notifications-api image
run: |
docker pull ${{vars.REGISTRY}}/${{github.repository_owner}}/nr-bcws-wfnews-wfone-notifications-api:${{ env.branch-name }}
docker tag ${{vars.REGISTRY}}/${{github.repository_owner}}/nr-bcws-wfnews-wfone-notifications-api:${{ env.branch-name }} ${{vars.REGISTRY}}/${{github.repository_owner}}/nr-bcws-wfnews-wfone-notifications-api:${{ env.IMAGE_TAG }}
docker push ${{vars.REGISTRY}}/${{github.repository_owner}}/nr-bcws-wfnews-wfone-notifications-api:${{ env.IMAGE_TAG }}
- name: Tag notification-push-api image
run: |
docker pull ${{vars.REGISTRY}}/${{github.repository_owner}}/nr-bcws-wfnews-wfone-notification-push-api:${{ env.branch-name }}
docker tag ${{vars.REGISTRY}}/${{github.repository_owner}}/nr-bcws-wfnews-wfone-notification-push-api:${{ env.branch-name }} ${{vars.REGISTRY}}/${{github.repository_owner}}/nr-bcws-wfnews-wfone-notification-push-api:${{ env.IMAGE_TAG }}
docker push ${{vars.REGISTRY}}/${{github.repository_owner}}/nr-bcws-wfnews-wfone-notification-push-api:${{ env.IMAGE_TAG }}
- name: Tag wfss-pointid-api image
run: |
docker pull ${{vars.REGISTRY}}/${{github.repository_owner}}/nr-bcws-wfnews-wfss-pointid-api:${{ env.branch-name }}
docker tag ${{vars.REGISTRY}}/${{github.repository_owner}}/nr-bcws-wfnews-wfss-pointid-api:${{ env.branch-name }} ${{vars.REGISTRY}}/${{github.repository_owner}}/nr-bcws-wfnews-wfss-pointid-api:${{ env.IMAGE_TAG }}
docker push ${{vars.REGISTRY}}/${{github.repository_owner}}/nr-bcws-wfnews-wfss-pointid-api:${{ env.IMAGE_TAG }}
- run: echo ::set-output name=tag-value::${{ env.IMAGE_TAG }}
id: get-release-tag
terragrunt-deploy-test:
needs: [tag-images, call-lambda-zip]
uses: ./.github/workflows/terragrunt-deploy.yml
with:
DEFAULT_APPLICATION_ENVIRONMENT: TEST
IMAGE_TAG: ${{ needs.tag-images.outputs.tag-value }}
IS_HOTFIX: ${{ inputs.IS_HOTFIX }}
TARGET_ENV: test
MAX_RECEIVED_COUNT: 10
VISIBILITY_TIMEOUT_SECONDS: 100
PUSH_NOTIFICATION_AWS_USER: ""
EVENT_BRIDGE_ARN: ""
WFNEWS_URL: ""
BAN_PROHIBITION_MONITOR_KEY: ""
ACTIVE_FIRE_MONITOR_KEY: ""
AREA_RESTRICTIONS_MONITOR_KEY: ""
EVACUATION_MONITOR_KEY: ""
LAMBDA_LAYER_KEY: ""
secrets: inherit
ios-deploy:
uses: ./.github/workflows/ios.yml
needs: [tag-images]
with:
build_environment: TEST
upload_to_app_store: true
skip_slack_notification: false
secrets: inherit
android-deploy:
uses: ./.github/workflows/android.yml
needs: [tag-images]
with:
build_environment: TEST
upload_to_play_store: true
increment_version_number: true
skip_slack_notification: false
secrets: inherit