-
-
Notifications
You must be signed in to change notification settings - Fork 11
41 lines (40 loc) · 1.29 KB
/
push.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
name: push
on:
push:
branches: main
jobs:
dockerhub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: x64
- uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.6.1"
- name: Resolve dependencies
run: poetry export -f requirements.txt --without-hashes --output requirements.txt
- name: Build docker
run: docker build . -t pyronear/pyro-platform:latest
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to hub
run: docker push pyronear/pyro-platform:latest
deploy-dev:
needs: dockerhub
runs-on: ubuntu-latest
steps:
- uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SSH_DEV_HOST }}
username: ${{ secrets.SSH_DEV_USERNAME }}
key: ${{ secrets.SSH_DEPLOY_DEV }}
script: |
docker pull pyronear/pyro-platform:latest
cd pyro-platform-prod && docker compose down && docker compose up -d
docker inspect -f '{{ .Created }}' $(docker compose images -q frontend)