Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 5 additions & 33 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ jobs:
uses: actions/checkout@v4

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Docker Build and Push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: true
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/server:${{ github.run_number }}
${{ secrets.DOCKER_HUB_USERNAME }}/server:latest
Expand All @@ -34,41 +34,13 @@ jobs:
runs-on: self-hosted
steps:
- name: deploy
run: |
cd /home/ubuntu
sudo chmod +x ./deploy.sh
sudo ./deploy.sh
run: cd /home/ubuntu && ./deploy.sh

- name: Send Failure Message
if: ${{ failure() }}
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DEPLOY_WEBHOOK_URL }}
DISCORD_USERNAME: 배포봇
DISCORD_EMBEDS: |
[
{
"author": {
"name": "${{ github.event.pull_request.user.login }}",
"url": "https://github.com/techbloghub/server",
"icon_url": "${{ github.event.pull_request.user.avatar_url }}"
},
"title": "배포 실패! \n #${{ github.event.pull_request.number }} : ${{ github.event.pull_request.title }}",
"color": 13458524,
"description": "${{ github.event.pull_request.html_url }}",
"fields": [
{
"name": "Base Branch",
"value": "${{ github.base_ref }}",
"inline": true
},
{
"name": "Compare Branch",
"value": "${{ github.head_ref }}",
"inline": true
}
]
}
]
with:
args: ''
args: 'The deployment of techbloghub/{{ EVENT_PAYLOAD.repository.full_name }} has failed'
Loading