Skip to content

Commit

Permalink
why not running!
Browse files Browse the repository at this point in the history
  • Loading branch information
dazz committed Aug 4, 2024
1 parent 855a9ef commit 290ba22
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions .github/workflows/docker-image-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ jobs:
tag_name=$(curl -sH "Authorization: token $API_TOKEN" https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases/latest | jq -r '.tag_name' | cut -c2-)
echo "tag=$tag_name" >> $GITHUB_OUTPUT
echo $tag_name
echo "tag=$tag_name"
check_image_tag:
runs-on: ubuntu-latest
needs: latest_version
outputs:
image_exists: ${{ steps.check_image.outputs.image_exists }}
steps:
- name: Check image tag exists
id: check_image
Expand All @@ -35,33 +37,33 @@ jobs:
run: |
IMAGE_NAME="hakindazz/s6-overlay-base"
docker pull "$IMAGE_NAME:$LATEST_TAG" &> /dev/null
# if [ $? -eq 0 ]; then
# echo "image_exists=true" >> $GITHUB_OUTPUT
# else
# echo "image_exists=false" >> $GITHUB_OUTPUT
# fi
#
# build-and-push:
# runs-on: ubuntu-latest
# needs: [latest_version, check_image_tag]
# if: "!needs.check_image_tag.outputs.image_exists"
# steps:
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
#
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
#
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
#
# - name: Build and push
# uses: docker/build-push-action@v6
# with:
# push: true
# tags: |
# hakindazz/s6-overlay-base:latest
# hakindazz/s6-overlay-base:${{ needs.latest_version.outputs.tag }}
if [ $? -eq 0 ]; then
echo "image_exists=true" >> $GITHUB_OUTPUT
else
echo "image_exists=false" >> $GITHUB_OUTPUT
fi
build-and-push:
runs-on: ubuntu-latest
needs: [latest_version, check_image_tag]
if: "!needs.check_image_tag.outputs.image_exists"
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: |
hakindazz/s6-overlay-base:latest
hakindazz/s6-overlay-base:${{ needs.latest_version.outputs.tag }}

0 comments on commit 290ba22

Please sign in to comment.