9595 echo "ECS_CLUSTER=$(echo "$TF_OUTPUTS" | jq -r '.ecs_cluster_name.value')" >> $GITHUB_ENV
9696 echo "ECS_SERVICE=$(echo "$TF_OUTPUTS" | jq -r '.ecs_api_service_name.value')" >> $GITHUB_ENV
9797 echo "CONTAINER_NAME=$(echo "$TF_OUTPUTS" | jq -r '.ecs_api_container_name.value')" >> $GITHUB_ENV
98+ echo "PRIVATE_IP=$(echo "$TF_OUTPUTS" | jq -r '.ec2_private_ip.value')" >> $GITHUB_ENV
9899
99100 - name : Configure AWS credentials
100101 uses : aws-actions/configure-aws-credentials@v4
@@ -103,13 +104,29 @@ jobs:
103104 aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
104105 aws-region : ${{ env.AWS_REGION }}
105106
107+ - name : Update MYSQL_URL in Parameter Store
108+ run : |
109+ MYSQL_URL="jdbc:mysql://${PRIVATE_IP}:3306/eatda?useUnicode=true&characterEncoding=UTF-8"
110+
111+ aws ssm put-parameter \
112+ --name "/dev/MYSQL_URL" \
113+ --type "SecureString" \
114+ --value "$MYSQL_URL" \
115+ --overwrite
116+
106117 - name : Set up Node.js
107118 uses : actions/setup-node@v4
108119 with :
109120 node-version : ' 22'
110121
111122 - name : Install Semantic Release dependencies
112- run : npm install semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator conventional-changelog-conventionalcommits
123+ run : |
124+ npm install \
125+ semantic-release \
126+ @semantic-release/commit-analyzer \
127+ @semantic-release/release-notes-generator \
128+ @semantic-release/github \
129+ conventional-changelog-conventionalcommits
113130
114131 - name : Semantic Release
115132 id : get_version
@@ -134,11 +151,24 @@ jobs:
134151 architecture : ' x64'
135152 cache : ' gradle'
136153
154+ - name : Get TEST_JWT_SECRET_KEY from SSM
155+ id : get-test-secret
156+ run : |
157+ SECRET_VALUE=$(aws ssm get-parameter \
158+ --name "/common/TEST_JWT_SECRET_KEY" \
159+ --with-decryption \
160+ --region "${{ env.AWS_REGION }}" \
161+ --query "Parameter.Value" \
162+ --output text)
163+ echo "TEST_JWT_SECRET_KEY=$SECRET_VALUE" >> $GITHUB_ENV
164+
137165 - name : Build with Gradle
138166 run : |
139167 cd ${{ github.workspace }}
140168 chmod +x gradlew
141- ./gradlew clean build
169+ ./gradlew clean build -Dspring.profiles.active=dev
170+ env :
171+ TEST_JWT_SECRET_KEY : ${{ env.TEST_JWT_SECRET_KEY }}
142172
143173 - name : Login to Amazon ECR
144174 id : login-ecr
@@ -169,7 +199,7 @@ jobs:
169199 image : ${{ env.image }}
170200
171201 - name : Deploy Amazon ECS task definition
172- uses : aws-actions/amazon-ecs-deploy-task-definition@v1
202+ uses : aws-actions/amazon-ecs-deploy-task-definition@v2
173203 with :
174204 task-definition : ${{ steps.task-def.outputs.task-definition }}
175205 service : ${{ env.ECS_SERVICE }}
@@ -208,4 +238,4 @@ jobs:
208238 **시도 버전**: ${{ env.SEMANTIC_VERSION }}
209239 **커밋**: [${{ steps.vars.outputs.sha_short }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
210240 **요청자**: ${{ github.actor }}
211- embed-url : " ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
241+ embed-url : " ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
0 commit comments