Skip to content

Commit

Permalink
Add push check
Browse files Browse the repository at this point in the history
  • Loading branch information
dmohns committed Oct 22, 2024
1 parent ea600eb commit 8cbdfe2
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/release-publish-dockerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Get version
run: |
VERSION=$(cat version)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -31,6 +26,33 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get version
run: |
VERSION=$(cat version)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Check if image tag already exists Frontend
run: |
IMAGE_NAME="enaccess/micropowermanager-frontend"
VERSION="${{ env.VERSION }}"
if docker manifest inspect $IMAGE_NAME:$VERSION > /dev/null 2>&1; then
echo "Docker image tag $VERSION already exists."
exit 1
else
echo "Docker image tag $VERSION does not exist. Proceeding with build."
fi
- name: Check if image tag already exists Backend
run: |
IMAGE_NAME="enaccess/micropowermanager-frontend"
VERSION="${{ env.VERSION }}"
if docker manifest inspect $IMAGE_NAME:$VERSION > /dev/null 2>&1; then
echo "Docker image tag $VERSION already exists."
exit 1
else
echo "Docker image tag $VERSION does not exist. Proceeding with build."
fi
- name: Build and push Docker image Frontend
uses: docker/build-push-action@v5
with:
Expand Down

0 comments on commit 8cbdfe2

Please sign in to comment.