-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Adds continuous deployment through DockerHub (#114)
* feat: Make docker image lighter * ci: Adds CI job to push & deploy image * ci: Updates docker build job * ci: Fix docker network creation
- Loading branch information
Showing
4 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 src/app/requirements.txt | ||
- name: Build docker | ||
run: docker build src/. -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 devops && docker compose down && docker compose up -d | ||
docker inspect -f '{{ .Created }}' $(docker compose images -q frontend) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters