Skip to content

Commit

Permalink
Add steps to publish Docker image as latest and versioned to GHCR
Browse files Browse the repository at this point in the history
  • Loading branch information
G-D-Petrov committed Dec 19, 2024
1 parent 1d5a384 commit cb303ce
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/dev_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ jobs:
run: |
docker build -t $image_name . -f docker/Dockerfile
- name: Publish Docker image to GHCR
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master'
- name: Login to GHCR
run: docker login ghcr.io -u token -p "${{secrets.GITHUB_TOKEN}}"

- name: Publish Docker versioned image to GHCR
run: |
docker login ghcr.io -u token -p "${{secrets.GITHUB_TOKEN}}"
docker tag $image_name $image_name:$image_ver
docker push $image_name:$image_ver
- name: Publish Docker image to GHCR as latest
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master'
run: |
docker tag $image_name $image_name:latest
docker push $image_name:latest

0 comments on commit cb303ce

Please sign in to comment.