From 3adc17ab32d705ed0ef1098ef3fd24ff2b170ba4 Mon Sep 17 00:00:00 2001 From: Jagrit Thapar Date: Sat, 7 Sep 2024 09:49:08 +0530 Subject: [PATCH] trigger build on test branch --- .gitea/workflows/build.yaml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 16e7771..381c4f3 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -3,6 +3,7 @@ on: push: branches: - main + - gitea_actions jobs: build-and-push: @@ -10,7 +11,7 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v4 + uses: actions/checkout@v2 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v2 @@ -18,19 +19,19 @@ jobs: - name: Login to Container Registry to push the artifact after build run: echo "${{ secrets.CR_passkey }}" | docker login ${{ secrets.CR_endpoint }} -u ${{ secrets.CR_username }} --password-stdin - - name: Generate tag for the image - run: | - SHA_TAG=${CI_COMMIT_SHA::5} - REPO_NAME=$(basename $CI_REPOSITORY) - IMAGE_TAG_SHA="${{ secrets.CR_endpoint }}/${{ secrets.CR_username }}/${REPO_NAME}:${SHA_TAG}" -# IMAGE_TAG_LATEST="${{ secrets.CR_endpoint }}/${{ secrets.CR_username }}/${REPO_NAME}:latest" +# - name: Generate tag for the image +# run: | +# SHA_TAG=${CI_COMMIT_SHA::5} +# IMAGE_TAG_SHA="${{ secrets.CR_endpoint }}/${{ secrets.CR_username }}/${CI_PROJECT_NAME}:latest" +# echo "${SHA_TAG}" +## IMAGE_TAG_LATEST="${{ secrets.CR_endpoint }}/${{ secrets.CR_username }}/${CI_PROJECT_NAME}:latest" - name: Build container image - run: docker build -t $IMAGE_TAG_SHA . # -t $IMAGE_TAG_LATEST . + run: docker build -t gitea.jagrit.dev/jagrit007/golang-webapp-devopsify . - name: Push Docker image to Container Registry run: | - docker push $IMAGE_TAG_SHA + docker push gitea.jagrit.dev/jagrit007/golang-webapp-devopsify