ci(push): 👷 add develop branch and remove second tag (#694)

Signed-off-by: Prashant Shahi <prashant@signoz.io>
This commit is contained in:
Prashant Shahi 2022-02-09 20:35:25 +05:30 committed by GitHub
parent 03eac8963f
commit 420f601a68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 16 deletions

View File

@ -7,6 +7,7 @@ on:
- 'frontend/**'
branches:
- main
- develop
tags:
- ^v[0-9]+.[0-9]+.[0-9]+$
@ -33,10 +34,16 @@ jobs:
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1
- name: Set docker tag environment
run: |
if [ '${{ steps.branch-name.outputs.is_tag }}' == 'true' ]; then
echo "DOCKER_TAG=${{ steps.branch-name.outputs.tag }}" >> $GITHUB_ENV
elif [ '${{ steps.branch-name.outputs.current_branch }}' == 'main' ]; then
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
else
echo "DOCKER_TAG=${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_ENV
fi
- name: Build and push docker image
env:
DOCKER_TAG: ${{ steps.short-sha.outputs.sha }}
DOCKER_SECOND_TAG: ${{ steps.branch-name.outputs.current_branch }}
run: make build-push-query-service
image-build-and-push-frontend:
@ -69,8 +76,14 @@ jobs:
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1
- name: Set docker tag environment
run: |
if [ '${{ steps.branch-name.outputs.is_tag }}' == 'true' ]; then
echo "DOCKER_TAG=${{ steps.branch-name.outputs.tag }}" >> $GITHUB_ENV
elif [ '${{ steps.branch-name.outputs.current_branch }}' == 'main' ]; then
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
else
echo "DOCKER_TAG=${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_ENV
fi
- name: Build and push docker image
env:
DOCKER_TAG: ${{ steps.short-sha.outputs.sha }}
DOCKER_SECOND_TAG: ${{ steps.branch-name.outputs.current_branch }}
run: make build-push-frontend

View File

@ -45,13 +45,8 @@ build-push-frontend:
@echo "------------------"
@echo "--> Building and pushing frontend docker image"
@echo "------------------"
ifndef DOCKER_SECOND_TAG
@cd $(FRONTEND_DIRECTORY) && \
docker buildx build --file Dockerfile --progress plane --no-cache --push --platform linux/amd64 --tag $(REPONAME)/$(FRONTEND_DOCKER_IMAGE):$(DOCKER_TAG) .
else
@cd $(FRONTEND_DIRECTORY) && \
docker buildx build --file Dockerfile --progress plane --no-cache --push --platform linux/amd64 --tag $(REPONAME)/$(FRONTEND_DOCKER_IMAGE):$(DOCKER_TAG) --tag $(REPONAME)/$(FRONTEND_DOCKER_IMAGE):$(DOCKER_SECOND_TAG) .
endif
# Steps to build and push docker image of query service
.PHONY: build-query-service-amd64 build-push-query-service
@ -68,13 +63,8 @@ build-push-query-service:
@echo "------------------"
@echo "--> Building and pushing query-service docker image"
@echo "------------------"
ifndef DOCKER_SECOND_TAG
@cd $(QUERY_SERVICE_DIRECTORY) && \
docker buildx build --file Dockerfile --progress plane --no-cache --push --platform linux/arm64,linux/amd64 --build-arg LD_FLAGS=$(LD_FLAGS) --tag $(REPONAME)/$(QUERY_SERVICE_DOCKER_IMAGE):$(DOCKER_TAG) .
else
@cd $(QUERY_SERVICE_DIRECTORY) && \
docker buildx build --file Dockerfile --progress plane --no-cache --push --platform linux/arm64,linux/amd64 --build-arg LD_FLAGS=$(LD_FLAGS) --tag $(REPONAME)/$(QUERY_SERVICE_DOCKER_IMAGE):$(DOCKER_TAG) --tag $(REPONAME)/$(QUERY_SERVICE_DOCKER_IMAGE):$(DOCKER_SECOND_TAG) .
endif
# Steps to build and push docker image of flattener
.PHONY: build-flattener-amd64 build-push-flattener