Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dldmsql committed Sep 4, 2024
2 parents fd54eb5 + d6df45c commit 69b6f28
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/healthCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "[운영] 헬스체크"

on:
schedule:
- cron: "0 0 */3 * *"

jobs:
healthcheck:
runs-on: ubuntu-latest
steps:
- name: API Health Check
id: health_check
uses: jtalk/url-health-check-action@v3
with:
url: ${{ secrets.BASE_URI_PROD }}
max-attempts: 3
retry-delay: 1s

- name: Discord Webhook Action
if: always()
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
content: ${{ job.status }}
9 changes: 4 additions & 5 deletions src/main/kotlin/com/ddd/sonnypolabobe/global/util/S3Util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ class S3Util(
@Value("\${cloud.aws.region.static}")
private val region: String,
@Value("\${running.name}")
private val runningName: String
private val runningName: String,
@Value("\${aws.cloudfront.domain}")
private val cloudfrontDomain: String,
) {

fun awsCredentials(): BasicAWSCredentials {
Expand All @@ -50,10 +52,7 @@ class S3Util(
return amazonS3Client().generatePresignedUrl(request)
}

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

fun deleteImage(fileUrl: String) {
try {
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ cloud:
bucket: ENC(nLu55KOteQJS+LGFKjfITxZdfaWyZV6C)
region:
static: ap-northeast-2
aws:
cloudfront:
domain: ENC(5AUXhCDMkJlNZa6tI8NIRY3z1kXAtgF0Bb6N3DyujlkOg0iJqK6mV7YYd5rMm1X3)

running:
name: dev
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ cloud:
bucket: ENC(nLu55KOteQJS+LGFKjfITxZdfaWyZV6C)
region:
static: ap-northeast-2
aws:
cloudfront:
domain: ENC(5AUXhCDMkJlNZa6tI8NIRY3z1kXAtgF0Bb6N3DyujlkOg0iJqK6mV7YYd5rMm1X3)

running:
name: local
Expand Down

0 comments on commit 69b6f28

Please sign in to comment.