-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (29 loc) · 914 Bytes
/
main.yml
File metadata and controls
29 lines (29 loc) · 914 Bytes
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
name: Duild and deploy Docker container
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build the tagged Docker image
run: docker build . --file Dockerfile --tag korneevm/capaldi
- name: Push the tagged Docker image
run: docker push korneevm/capaldi
- name: login to server and pull container
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script_stop: true
script: |
cd /opt/servers
docker-compose pull capaldi-bot
docker-compose up -d