-
Notifications
You must be signed in to change notification settings - Fork 17
39 lines (35 loc) · 1.05 KB
/
bot-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
name: Build And Deploy Bot Image
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to Docker Hub
run: docker login -u ${{ secrets.ORG_DOCKER_USERNAME }} -p ${{ secrets.ORG_DOCKER_PASSWORD }}
- name: Build & Push the Docker image
run: |
docker build . --file Dockerfile.prod --tag wiseoldman/discord-bot:latest
docker push wiseoldman/discord-bot:latest
deploy:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Restart docker
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DO_HOST }}
username: ${{ secrets.DO_USER }}
passphrase: ${{ secrets.DO_SSH_PASS }}
key: ${{ secrets.DO_SSH_KEY }}
script: |
cd wise-old-man
docker image rm wiseoldman/discord-bot
docker-compose pull bot
docker-compose up -d --no-deps --build bot