Skip to content

Commit

Permalink
[ci] publish dev image on every push
Browse files Browse the repository at this point in the history
  • Loading branch information
ioj4 committed Jan 16, 2025
1 parent 9d7104b commit b5cb7c2
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
workflow_dispatch:
push:
branches: main
paths: CHANGELOG.md

jobs:
publish:
Expand All @@ -25,12 +24,20 @@ jobs:
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Check if version already exists in registry
- name: Create Docker Image tags
run: |
TAGS="ghcr.io/${{ github.repository }}:dev"
if docker manifest inspect ghcr.io/${{ github.repository }}:0.0.$VERSION > /dev/null 2>&1; then
echo "Image with version 0.0.$VERSION already exists in registry"
exit 1
echo "Image with version (0.0.$VERSION) already exists in registry"
echo "Publishing a dev image.."
else
echo "Image with version (0.0.$VERSION) does not exist in the registry yet"
echo "Publishing a release and a dev image.."
TAGS="${TAGS},\
ghcr.io/${{ github.repository }}:0.0.${{ env.VERSION }},\
ghcr.io/${{ github.repository }}:latest"
fi
echo "TAGS=${TAGS}" >> $GITHUB_ENV
- name: Log in to ghcr.io
uses: docker/login-action@v3
Expand All @@ -48,9 +55,7 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}:0.0.${{ env.VERSION }}
ghcr.io/${{ github.repository }}:latest
tags: ${{ env.TAGS }}
platforms: linux/amd64,linux/arm64,linux/arm/v7

- name: Update on server
Expand Down

0 comments on commit b5cb7c2

Please sign in to comment.