Skip to content

Docs: README.md μž‘μ„± (#233) #79

Docs: README.md μž‘μ„± (#233)

Docs: README.md μž‘μ„± (#233) #79

Workflow file for this run

name: Deploy
on:
push:
branches:
- Weekly
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout Repository
uses: actions/checkout@v4
- name: πŸ” Set Up SSH Authentication
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: πŸš€ Run Deployment Script on Server
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
ssh -o StrictHostKeyChecking=no ubuntu@${{ secrets.SERVER_IP }} "SLACK_WEBHOOK_URL=${{ secrets.SLACK_WEBHOOK_URL }} bash /home/ubuntu/deploy.sh"
# μ„œλ²„μ˜ deploy.sh 슀크립트λ₯Ό 톡해 무쀑단 배포λ₯Ό μ§„ν–‰ν•©λ‹ˆλ‹€.
# 무쀑단 배포 성곡 μ‹œ Slack μ•Œλ¦Όμ„ μ „μ†‘ν•˜λ„λ‘ μ„€μ •λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.
- name: πŸ“’ Notify Deployment Status on Slack
if: always()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
if [ $? -eq 0 ]; then
curl -X POST -H 'Content-type: application/json' --data '{"text": "πŸŽ‰ *μ΅œμ’… 배포 성곡* - 배포가 μ„±κ³΅μ μœΌλ‘œ μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€!"}' $SLACK_WEBHOOK_URL
else
curl -X POST -H 'Content-type: application/json' --data '{"text": "⚠️ *배포 μ‹€νŒ¨* - 배포 κ³Όμ •μ—μ„œ λ¬Έμ œκ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€."}' $SLACK_WEBHOOK_URL
fi
# 배포 μŠ€ν¬λ¦½νŠΈκ°€ μ„±κ³΅μ μœΌλ‘œ μ‹€ν–‰λ˜μ—ˆλŠ”μ§€ μ—¬λΆ€λ₯Ό Slack으둜 μ•Œλ¦½λ‹ˆλ‹€.