Skip to content

Commit

Permalink
πŸ’š Deploy μ›Œν¬ν”Œλ‘œμš° μ›Ήν›… μ„€μ •
Browse files Browse the repository at this point in the history
  • Loading branch information
waterfogSW committed Sep 22, 2024
1 parent 530b6be commit 552e838
Showing 1 changed file with 88 additions and 2 deletions.
90 changes: 88 additions & 2 deletions .github/workflows/cd-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
ECR_REPOSITORY: threedays-app
EB_APPLICATION_NAME: threedays-dev
EB_ENVIRONMENT_NAME: threedays-dev-env
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}

jobs:
deploy:
Expand All @@ -26,6 +27,33 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Send Deployment Start Webhook
run: |
curl -H "Content-Type: application/json" -X POST -d '{
"content": "배포가 μ‹œμž‘λ˜μ—ˆμŠ΅λ‹ˆλ‹€.",
"embeds": [{
"title": "배포 μ‹œμž‘",
"color": 16776960,
"fields": [
{
"name": "버전",
"value": "${{ github.event.inputs.version || github.event.client_payload.version || 'latest' }}",
"inline": true
},
{
"name": "ν™˜κ²½",
"value": "'"${EB_ENVIRONMENT_NAME}"'",
"inline": true
},
{
"name": "배포자",
"value": "'"${GITHUB_ACTOR}"'",
"inline": true
}
]
}]
}' ${{ env.DISCORD_WEBHOOK }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand Down Expand Up @@ -117,6 +145,7 @@ jobs:
zip -r deploy.zip Dockerrun.aws.json .ebextensions
- name: Deploy to Elastic Beanstalk
id: deploy
uses: einaregilsson/beanstalk-deploy@v22
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -128,5 +157,62 @@ jobs:
deployment_package: deploy.zip
use_existing_version_if_available: false

- name: Deployment result
run: echo "Deployed version ${{ steps.determine-version.outputs.VERSION }} to Elastic Beanstalk environment ${{ env.EB_ENVIRONMENT_NAME }}"
- name: Send Deployment Success Webhook
if: success()
env:
VERSION: ${{ steps.determine-version.outputs.VERSION }}
run: |
curl -H "Content-Type: application/json" -X POST -d '{
"content": "배포가 μ„±κ³΅μ μœΌλ‘œ μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€!",
"embeds": [{
"title": "배포 성곡",
"color": 65280,
"fields": [
{
"name": "버전",
"value": "'"${VERSION}"'",
"inline": true
},
{
"name": "ν™˜κ²½",
"value": "'"${EB_ENVIRONMENT_NAME}"'",
"inline": true
},
{
"name": "배포자",
"value": "'"${GITHUB_ACTOR}"'",
"inline": true
}
]
}]
}' ${{ env.DISCORD_WEBHOOK }}
- name: Send Deployment Failure Webhook
if: failure()
env:
VERSION: ${{ steps.determine-version.outputs.VERSION }}
run: |
curl -H "Content-Type: application/json" -X POST -d '{
"content": "배포 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.",
"embeds": [{
"title": "배포 μ‹€νŒ¨",
"color": 16711680,
"fields": [
{
"name": "버전",
"value": "'"${VERSION}"'",
"inline": true
},
{
"name": "ν™˜κ²½",
"value": "'"${EB_ENVIRONMENT_NAME}"'",
"inline": true
},
{
"name": "배포자",
"value": "'"${GITHUB_ACTOR}"'",
"inline": true
}
]
}]
}' ${{ env.DISCORD_WEBHOOK }}

0 comments on commit 552e838

Please sign in to comment.