From c376d376dd931973505ea473de4c87f1d56503c1 Mon Sep 17 00:00:00 2001 From: SebClem Date: Mon, 20 Jun 2022 09:54:21 +0200 Subject: [PATCH 1/2] Force build --- src/main/java/net/Broken/Init.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/Broken/Init.java b/src/main/java/net/Broken/Init.java index 3c7f9cd..d7247ea 100644 --- a/src/main/java/net/Broken/Init.java +++ b/src/main/java/net/Broken/Init.java @@ -23,6 +23,7 @@ import javax.security.auth.login.LoginException; import java.util.List; + public class Init { static private Logger logger = LogManager.getLogger(); From 7965a42ee5f7a76dc37b49b7c2b41cba966ed8ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Cl=C3=A9ment?= Date: Wed, 29 Jun 2022 16:43:29 +0200 Subject: [PATCH 2/2] Update build.yml --- .github/workflows/build.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60ac959..ef99f41 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,9 +5,6 @@ name: Build on: push: - branches: [ master ] - pull_request: - branches: [ master ] jobs: build-gradle: @@ -38,7 +35,6 @@ jobs: runs-on: ubuntu-latest needs: - build-gradle - if: github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v2 @@ -60,10 +56,24 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.CR_PAT }} + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v5.2 + + - name: Set tag master + if: steps.branch-name.outputs.current_branch == 'master' + run: | + echo "tag=latest" >> $GITHUB_ENV + + - name: Set tag + if: steps.branch-name.outputs.current_branch != 'master' + run: | + echo "tag=${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_ENV + - name: Build and push Docker uses: docker/build-push-action@v2 with: push: true context: . - tags: ghcr.io/sebclem/claptrapbot:latest - file: ./Dockerfile \ No newline at end of file + tags: "ghcr.io/sebclem/claptrapbot:${{ env.tag }}" + file: ./Dockerfile