diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index e490c33..b761398 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -8,26 +8,35 @@ 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: @@ -35,7 +44,7 @@ jobs: 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: @@ -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 }}