mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-08-16 13:47:28 +02:00
Update push-docker.yml
This commit is contained in:
parent
57b12ffcc3
commit
aed28c0ace
20
.github/workflows/push-docker.yml
vendored
20
.github/workflows/push-docker.yml
vendored
@ -4,6 +4,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- testGit
|
||||
- main
|
||||
jobs:
|
||||
push:
|
||||
@ -38,19 +39,34 @@ jobs:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_API }}
|
||||
|
||||
- name: Check if tag exists
|
||||
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 }} doesn't exist. Continuing with build and push."
|
||||
else
|
||||
echo "Tag {{ steps.versionNumber.outputs.versionNumber }} already exists. Skipping build and push."
|
||||
env:
|
||||
JOB_END_EARLY: true
|
||||
fi
|
||||
|
||||
|
||||
|
||||
- name: Setup buildx
|
||||
if: env.JOB_END_EARLY != true
|
||||
run: |
|
||||
docker buildx create --name mybuilder
|
||||
docker buildx use mybuilder
|
||||
|
||||
- name: Build and push versioned amd64 and v8
|
||||
if: github.ref == 'refs/heads/main'
|
||||
if: github.ref == 'refs/heads/main' and env.JOB_END_EARLY != true
|
||||
run: |
|
||||
docker buildx build --platform="linux/amd64,linux/arm64/v8" --push --tag "frooodle/s-pdf:${{ steps.versionNumber.outputs.versionNumber }}" .
|
||||
|
||||
|
||||
- name: Build and push latest amd64 and v8
|
||||
if: github.ref == 'refs/heads/master'
|
||||
if: github.ref == 'refs/heads/master' and env.JOB_END_EARLY != true
|
||||
run: |
|
||||
docker buildx build --platform="linux/amd64,linux/arm64/v8" --push --tag "frooodle/s-pdf:latest" .
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user