diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 7ab0265..a510266 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -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 @@ -34,10 +34,7 @@ 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() }} @@ -45,30 +42,5 @@ jobs: 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'