Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kirmorozov authored Apr 1, 2024
1 parent 8be046a commit ecdc20e
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Login to DigitalOcean Container Registry
uses: docker/login-action@v3
with:
registry: registry.digitalocean.com
username: ${{ secrets.DIGITALOCEAN_USERNAME }}
password: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- uses: actions/checkout@v3

- name: Download BlazeFace
Expand All @@ -22,23 +28,12 @@ jobs:
path: 'model/blazeface'

- name: Build the Docker image
run: docker build . --file build/Dockerfile --tag the-smile:$(date +%Y%m%d-%s) --tag the-smile:latest

# - name: Tar the image
# run: docker save the-smile:latest | gzip > smile_latest.tar.gz

- name: copy image to server
run: ssh -i <(echo $key) $user@$host ls -la
env:
host: ${{ secrets.SSH_HOST }}
user: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
# - name: copy file via ssh key
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USER }}
# port: 22
# key: ${{ secrets.SSH_KEY }}
# source: "smile_latest.tar.gz"
# target: /srv/smile/smile_latest.tar.gz
run: docker build . --file build/Dockerfile --tag thesmile:$(date +%Y%m%d-%s) --tag thesmile:latest

- name: Tag for DO
run: docker image tag thesmile:latest registry.digitalocean.com/thesmile/thesmile:latest

- name: Push to DO
run: docker image tag thesmile:latest registry.digitalocean.com/thesmile/thesmile:latest


0 comments on commit ecdc20e

Please sign in to comment.