From 52abc924149a10f2a0a0500de687c4c11cab904e Mon Sep 17 00:00:00 2001 From: "aleksandr.vodyanov" Date: Tue, 8 Oct 2024 13:00:43 +0300 Subject: [PATCH] [DO-1171] fixed gitea actions (#4) Reviewed-on: https://git.avroid.tech/Docker/tavro-build-linux/pulls/4 Co-authored-by: aleksandr.vodyanov Co-committed-by: aleksandr.vodyanov --- .gitea/workflows/build-and-push-image.yaml | 6 +++--- Makefile | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/build-and-push-image.yaml b/.gitea/workflows/build-and-push-image.yaml index 6be9649..1017f63 100644 --- a/.gitea/workflows/build-and-push-image.yaml +++ b/.gitea/workflows/build-and-push-image.yaml @@ -27,14 +27,14 @@ jobs: - name: Check out repository code uses: actions/checkout@v3 - - name: "Build image and push" + - name: "Build image" run: | make build - name: "Push image" run: | make push - if: gitea.branch_name == 'master' + if: ${{ gitea.ref == 'refs/heads/master' }} - name: "Clear image" run: | @@ -46,4 +46,4 @@ jobs: git config user.email "svc-jenkins@avroid.tech" git tag $(make getTag) git push origin $(make getTag) - if: gitea.branch_name == 'master' + if: ${{ gitea.ref == 'refs/heads/master' }} diff --git a/Makefile b/Makefile index 417108e..9985e3e 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,11 @@ IMAGE_GROUP = tavro IMAGE_TAG = 1.3 REVISION = DOCKER_REGISTRY = harbor.avroid.tech +CI_FLAGS = + +ifeq ($(CI), true) + CI_FLAGS = --no-cache +endif all: @echo 'DEFAULT:' @@ -13,17 +18,13 @@ all: @echo ' make getTag' @echo ' make clean' + build: -ifeq ($(CI), false) - CI_FLAGS='--no-cache' -endif - - DOCKER_BUILDKIT=1 $(CI_FLAGS) \ - docker build \ + DOCKER_BUILDKIT=1 docker build $(CI_FLAGS) \ -f Dockerfile \ --platform linux/amd64 \ - --network "host" \ + --network host \ -t $(DOCKER_REGISTRY)/$(IMAGE_GROUP)/$(IMAGE_NAME):$(IMAGE_TAG)$(REVISION) src/ push: