-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.15 KB
/
cd.yml
File metadata and controls
46 lines (39 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: deploy
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to DockerHub
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@v6
with:
context: .
push: true
file: ./Dockerfile
platforms: linux/amd64
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/server:${{ github.run_number }}
${{ secrets.DOCKER_HUB_USERNAME }}/server:latest
deploy:
needs: build
runs-on: self-hosted
steps:
- name: deploy
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: 배포봇
with:
args: 'The deployment of techbloghub/{{ EVENT_PAYLOAD.repository.full_name }} has failed'