forked from Invertex/UDHBot
-
Notifications
You must be signed in to change notification settings - Fork 7
53 lines (45 loc) · 1.34 KB
/
DeployProd.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
name: Deploy to UDC Server
on:
push:
branches: [master]
workflow_dispatch:
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/unity-developer-community/udc-bot:latest
restart:
name: Restart Bot
needs: push_to_registry
runs-on: ubuntu-latest
environment:
name: prod
steps:
- name: Run commands in SSH
uses: appleboy/ssh-action@master
with:
script: |
cd ${{ secrets.SERVER_BUILD_DIR }}
docker-compose pull
docker-compose up -d
host: ${{ secrets.SERVER_IP }}
port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.SERVER_USER }}
password: ${{ secrets.SERVER_PASSWORD }}
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: Bot has been deployment to UDC Server successfully.