-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 2.02 KB
/
deploy.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Deploy
on:
push:
branches: [ "develop" ]
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Slack notification
uses: 8398a7/action-slack@v3
with:
text: Deploy Start
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
- uses: actions/checkout@v3
- name: Login To Docker Registry
run: echo "${{ secrets.GIT_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Build Docker Image
run: |
IMAGE_ID=$(echo ghcr.io/${{ github.repository_owner }}/boated-fe | tr '[A-Z]' '[a-z]')
echo IMAGE_ID=$IMAGE_ID
docker build -t $IMAGE_ID:${{github.sha}} -t $IMAGE_ID:latest .
docker push $IMAGE_ID:${{github.sha}}
docker push $IMAGE_ID:latest
- name: Deploy To Develop Server
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DEPLOY_SERVER_HOST}}
username: ${{secrets.DEPLOY_USERNAME}}
password: ${{secrets.DEPLOY_PASSWORD}}
script: cd boated ; sh boated-fe.sh
- name: Slack notification Success
if: success()
uses: 8398a7/action-slack@v3
with:
text: Deploy Success
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
- name: Slack notification Fail
if: failure()
uses: 8398a7/action-slack@v3
with:
text: Deploy Fail
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required