Update push-docker.yml
This commit is contained in:
parent
e40e47df7d
commit
f7d320ac32
1 changed files with 19 additions and 13 deletions
32
.github/workflows/push-docker.yml
vendored
32
.github/workflows/push-docker.yml
vendored
|
@ -39,18 +39,18 @@ jobs:
|
|||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_API }}
|
||||
|
||||
- name: Check if tag exists
|
||||
id: checkIdExists
|
||||
continue-on-error: true
|
||||
run: |
|
||||
response=$(curl -s https://hub.docker.com/v2/repositories/frooodle/s-pdf/tags/?name=${{ steps.versionNumber.outputs.versionNumber }})
|
||||
result=$(echo $response | jq ".results")
|
||||
if [ "$result" == "[]" ]; then
|
||||
echo "Tag ${{ steps.versionNumber.outputs.versionNumber }} doesnt exist. Continuing with build and push."
|
||||
else
|
||||
echo "Tag ${{ steps.versionNumber.outputs.versionNumber }} already exists. Skipping build and push."
|
||||
exit 1;
|
||||
fi
|
||||
# - name: Check if tag exists
|
||||
# id: checkIdExists
|
||||
# continue-on-error: true
|
||||
# run: |
|
||||
# response=$(curl -s https://hub.docker.com/v2/repositories/frooodle/s-pdf/tags/?name=${{ steps.versionNumber.outputs.versionNumber }})
|
||||
# result=$(echo $response | jq ".results")
|
||||
# if [ "$result" == "[]" ]; then
|
||||
# echo "Tag ${{ steps.versionNumber.outputs.versionNumber }} doesnt exist. Continuing with build and push."
|
||||
# else
|
||||
# echo "Tag ${{ steps.versionNumber.outputs.versionNumber }} already exists. Skipping build and push."
|
||||
# exit 1;
|
||||
# fi
|
||||
|
||||
|
||||
|
||||
|
@ -58,9 +58,15 @@ jobs:
|
|||
run: |
|
||||
docker buildx create --name mybuilder
|
||||
docker buildx use mybuilder
|
||||
|
||||
- name: Build and push versioned amd64 and v8
|
||||
if: github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
docker buildx build --platform="linux/amd64,linux/arm64/v8" --push --tag "frooodle/s-pdf:${{ steps.versionNumber.outputs.versionNumber }}-alpha" .
|
||||
|
||||
|
||||
- name: Build and push versioned amd64 and v8
|
||||
if: github.ref == 'refs/heads/main' && steps.checkIdExists.outcome != 'failure'
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
docker buildx build --platform="linux/amd64,linux/arm64/v8" --push --tag "frooodle/s-pdf:${{ steps.versionNumber.outputs.versionNumber }}" .
|
||||
|
||||
|
|
Loading…
Reference in a new issue