diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 223ba07..4ebef6e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -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 @@ -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/scp-action@v0.1.7 - # 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 + +