-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (52 loc) · 1.8 KB
/
PROXY_BUILD.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
name: Proxy Dockerfile Build
on:
pull_request:
branches:
- release
paths:
- "nginx/Dockerfile"
jobs:
proxy-build:
name: proxy-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: GitHub Container Registry 로그인
uses: docker/login-action@v1
with:
registry: ghcr.io
username: kumsil1006
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Docker Compose 파일 운영 서버로 복사
uses: appleboy/scp-action@master
with:
host: ${{ secrets.RELEASE_HOST }}
username: ${{ secrets.RELEASE_USERNAME }}
password: ${{ secrets.RELEASE_PASSWORD }}
port: ${{ secrets.RELEASE_PORT }}
source: "docker-compose.yml"
target: "oao"
- name: 운영 서버에서 Docker Compose 실행
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.RELEASE_HOST }}
username: ${{ secrets.RELEASE_USERNAME }}
password: ${{ secrets.RELEASE_PASSWORD }}
port: ${{ secrets.RELEASE_PORT }}
script: |
echo ${{secrets.CONTAINER_REGISTRY_TOKEN}} | docker login ghcr.io -u kumsil1006 --password-stdin
docker pull ghcr.io/kumsil1006/oao-proxy
cd oao
docker-compose -f docker-compose.yml up -d
docker image prune
- name: 실패시 슬랙 메시지 전송
if: ${{ failure() }}
uses: ./.github/actions/slack-notify
with:
slack_incoming_url: ${{ secrets.SLACK_INCOMING_URL }}
- name: 성공시 슬랙 메시지 전송
if: ${{ success() }}
uses: ./.github/actions/slack-notify
with:
status: success
slack_incoming_url: ${{ secrets.SLACK_INCOMING_URL }}