Skip to content

Commit

Permalink
Update build-docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gangefors authored Nov 11, 2024
1 parent a79a1a6 commit ab7f65e
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,43 @@ jobs:
runs-on: ubuntu-latest
steps:
-
name: Get latest airdcpp release
name: Get latest stable airdcpp release
run: |
echo "release_tag=$(curl -fsL https://web-builds.airdcpp.net/stable/ | grep "_64-bit_portable.tar.gz" | grep -v latest | sort -t "_" -k1.14rV | head -n1 | cut -d "_" -f 2)" >> $GITHUB_ENV
-
name: Does latest release exist as docker image
name: Does latest stable release exist as docker image
run: |
echo "num_rels_found=$(curl -fsL 'https://hub.docker.com/v2/repositories/gangefors/airdcpp-webclient/tags/?page_size=10&ordering=last_updated' | jq -r '.results[].name' | grep -c '${{env.release_tag}}')" >> $GITHUB_ENV
-
name: Get latest develop airdcpp release
run: |
echo "Version: ${{env.release_tag}} Existing tags: ${{env.num_rels_found}}"
echo "dev_tag=$(curl -fsL https://web-builds.airdcpp.net/develop/ | grep "_64-bit_portable.tar.gz" | grep -v latest | sort -t "_" -k1.14rV | head -n1 | cut -d "_" -f 2)" >> $GITHUB_ENV
-
if: ${{ env.num_rels_found == 0 }}
name: Does latest develop release exist as docker image
run: |
echo "num_dev_rels_found=$(curl -fsL 'https://hub.docker.com/v2/repositories/gangefors/airdcpp-webclient/tags/?page_size=10&ordering=last_updated' | jq -r '.results[].name' | grep -c '${{env.dev_tag}}')" >> $GITHUB_ENV
-
run: |
echo "Stable Version: ${{env.release_tag}} Existing tags: ${{env.num_rels_found}}"
echo "Develop Version: ${{env.dev_tag}} Existing tags: ${{env.num_dev_rels_found}}"
-
if: ${{ env.num_rels_found == 0 || env.num_dev_rels_found == 0 }}
name: Checkout
uses: actions/checkout@v3
-
if: ${{ env.num_rels_found == 0 }}
if: ${{ env.num_rels_found == 0 || env.num_dev_rels_found == 0 }}
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
if: ${{ env.num_rels_found == 0 }}
if: ${{ env.num_rels_found == 0 || env.num_dev_rels_found == 0 }}
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: gangefors
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
if: ${{ env.num_rels_found == 0 }}
name: Build and push
name: Build and push stable
id: docker_build
uses: docker/build-push-action@v3
with:
Expand All @@ -45,3 +54,14 @@ jobs:
tags: |
gangefors/airdcpp-webclient:latest
gangefors/airdcpp-webclient:${{ env.release_tag }}
-
if: ${{ env.num_dev_rels_found == 0 }}
name: Build and push develop
id: docker_build_dev
uses: docker/build-push-action@v3
with:
context: .
no-cache: true
push: true
tags: |
gangefors/airdcpp-webclient:${{ env.dev_tag }}

0 comments on commit ab7f65e

Please sign in to comment.