Skip to content

Commit

Permalink
Add ghcr publishing workflow (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
HonzaCuhel authored Aug 9, 2024
1 parent 64001ef commit aee6434
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish_image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publishing a docker image

on:
push:
branches: ['cli']

env:
NAME: luxonis/tools_cli

jobs:
ghcr-publish:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get tools-cli version
id: commit
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Docker login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Publish latest
run: |
docker build -t $NAME:latest .
docker tag $NAME:latest ghcr.io/$NAME:latest
docker push ghcr.io/$NAME:latest
- name: Publish tagged
run: |
VERSION=${{ steps.commit.outputs.sha }}
docker tag $NAME:latest ghcr.io/$NAME:$VERSION
docker push ghcr.io/$NAME:$VERSION
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ cd tools

```bash
# Building Docker image
docker build -t tools-cli .
docker build -t tools_cli .
# Running the image
docker run -v "${PWD}/shared_with_container:/app/shared_with_container" tools-cli shared_with_container/models/yolov8n-seg.pt --imgsz "416"
docker run -v "${PWD}/shared_with_container:/app/shared_with_container" tools_cli shared_with_container/models/yolov8n-seg.pt --imgsz "416"
```

### Using Docker compose
Expand All @@ -32,7 +32,7 @@ docker run -v "${PWD}/shared_with_container:/app/shared_with_container" tools-cl
# Building Docker image
docker compose build
# Running the image
docker compose run tools-cli shared_with_container/models/yolov6nr4.pt
docker compose run tools_cli shared_with_container/models/yolov6nr4.pt
```

### Using Python package
Expand Down

0 comments on commit aee6434

Please sign in to comment.