-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64001ef
commit aee6434
Showing
2 changed files
with
46 additions
and
3 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
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 |
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