Skip to content

Commit 69b6f28

Browse files
committed
Merge remote-tracking branch 'origin/main' into dev
2 parents fd54eb5 + d6df45c commit 69b6f28

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

.github/workflows/healthCheck.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "[운영] 헬스체크"
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 */3 * *"
6+
7+
jobs:
8+
healthcheck:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: API Health Check
12+
id: health_check
13+
uses: jtalk/url-health-check-action@v3
14+
with:
15+
url: ${{ secrets.BASE_URI_PROD }}
16+
max-attempts: 3
17+
retry-delay: 1s
18+
19+
- name: Discord Webhook Action
20+
if: always()
21+
uses: tsickert/[email protected]
22+
with:
23+
webhook-url: ${{ secrets.WEBHOOK_URL }}
24+
content: ${{ job.status }}

src/main/kotlin/com/ddd/sonnypolabobe/global/util/S3Util.kt

+4-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ class S3Util(
2828
@Value("\${cloud.aws.region.static}")
2929
private val region: String,
3030
@Value("\${running.name}")
31-
private val runningName: String
31+
private val runningName: String,
32+
@Value("\${aws.cloudfront.domain}")
33+
private val cloudfrontDomain: String,
3234
) {
3335

3436
fun awsCredentials(): BasicAWSCredentials {
@@ -50,10 +52,7 @@ class S3Util(
5052
return amazonS3Client().generatePresignedUrl(request)
5153
}
5254

53-
fun getImgUrl(fileName: String): String {
54-
val url: URL = amazonS3Client().getUrl(bucket, runningName + File.separator + fileName)
55-
return url.toString()
56-
}
55+
fun getImgUrl(fileName: String): String = "$cloudfrontDomain/$runningName/$fileName"
5756

5857
fun deleteImage(fileUrl: String) {
5958
try {

src/main/resources/application-dev.yml

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ cloud:
3131
bucket: ENC(nLu55KOteQJS+LGFKjfITxZdfaWyZV6C)
3232
region:
3333
static: ap-northeast-2
34+
aws:
35+
cloudfront:
36+
domain: ENC(5AUXhCDMkJlNZa6tI8NIRY3z1kXAtgF0Bb6N3DyujlkOg0iJqK6mV7YYd5rMm1X3)
3437

3538
running:
3639
name: dev

src/main/resources/application-local.yml

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ cloud:
3131
bucket: ENC(nLu55KOteQJS+LGFKjfITxZdfaWyZV6C)
3232
region:
3333
static: ap-northeast-2
34+
aws:
35+
cloudfront:
36+
domain: ENC(5AUXhCDMkJlNZa6tI8NIRY3z1kXAtgF0Bb6N3DyujlkOg0iJqK6mV7YYd5rMm1X3)
3437

3538
running:
3639
name: local

0 commit comments

Comments
 (0)