From 213722368d8c8c6d91585d86a6cb97c9a5fd0bce Mon Sep 17 00:00:00 2001 From: Fl3xm3ist3r Date: Sat, 7 Dec 2024 12:46:56 +0100 Subject: [PATCH] adjust build tags --- .github/workflows/docker-hub.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 1a8547c..79a6225 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -2,7 +2,7 @@ name: Docker Hub Image Deploy on: push: - branches: ["master"] + branches: ["main", "develop"] jobs: docker-image: @@ -27,11 +27,18 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push the Docker image - uses: docker/build-push-action@v5.3.0 - with: - context: . - push: true - tags: | - ${{ secrets.DOCKERHUB_USERNAME }}/allthemods10:latest - ${{ secrets.DOCKERHUB_USERNAME }}/allthemods10:${{ env.SERVER_VERSION }} +- name: Build and push the Docker image (versioned tag) + uses: docker/build-push-action@v5.3.0 + with: + context: . + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/allthemods10:${{ env.SERVER_VERSION }} + +- name: Build and push the Docker image (latest tag) + if: ${{ github.ref_name == 'main' }} + uses: docker/build-push-action@v5.3.0 + with: + context: . + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/allthemods10:latest +