-
Notifications
You must be signed in to change notification settings - Fork 15
33 lines (33 loc) · 952 Bytes
/
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
name: Publish Docker Image
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Publish to Registry
uses: elgohr/[email protected]
with:
name: knuthuehne/jedeschule-scrapers
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
deploy:
needs: build
runs-on: ubuntu-latest
environment: server
steps:
- name: Pull latest docker images and restart
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
cd /home/jedeschule/
sudo docker-compose pull scrapers
sudo docker-compose up --detach --build scrapers
sudo docker image prune -f