fix comparison & readme #11
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
name: Build and deploy yolo | |
on: | |
push: | |
branches: ["master", "actions"] | |
paths: | |
- "backend/yolo_model/**" | |
- ".github/workflows/yolo.yml" | |
pull_request: | |
branches: ["master"] | |
jobs: | |
build-yolo: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build the yolo Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: backend/yolo_model | |
push: false | |
tags: "yolo:latest" | |
load: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Save the yolo Docker image to file | |
run: | | |
mkdir artifacts | |
docker save yolo:latest > artifacts/yolo.tar | |
- name: | |
Install ssh keys | |
# check this thread to understand why its needed: | |
# <https://stackoverflow.com/a/70447517> | |
run: | | |
install -m 600 -D /dev/null ~/.ssh/id_rsa | |
echo "${{ secrets.M }}" > ~/.ssh/id_rsa | |
ssh-keyscan -H junction.nyman.dev > ~/.ssh/known_hosts | |
- name: Copy Docker images to server | |
run: | | |
docker save yolo:latest | bzip2 | ssh [email protected] "docker load && cd weihua && docker compose up -d && exit" | |
- name: cleanup | |
run: rm -rf ~/.ssh |