diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml new file mode 100644 index 000000000..471dae809 --- /dev/null +++ b/.github/workflows/nightly-build.yml @@ -0,0 +1,24 @@ +name: nightly-build +on: + schedule: + # Daily at 2:48am + - cron: '48 2 * * *' + +permissions: + contents: read + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Setup Go + uses: actions/setup-go@main + with: + go-version: 1.19.4 + id: go + - name: Code checkout + uses: actions/checkout@master + - name: Publish + run: | + LATEST_TAG=nightly PKG_TAG=nightly make publish diff --git a/Makefile b/Makefile index 5d88b49b2..7a26efdc4 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ PKG_PREFIX := github.com/VictoriaMetrics/VictoriaMetrics DATEINFO_TAG ?= $(shell date -u +'%Y%m%d-%H%M%S') BUILDINFO_TAG ?= $(shell echo $$(git describe --long --all | tr '/' '-')$$( \ git diff-index --quiet HEAD -- || echo '-dirty-'$$(git diff-index -u HEAD | openssl sha1 | cut -d' ' -f2 | cut -c 1-8))) +LATEST_TAG ?= latest PKG_TAG ?= $(shell git tag -l --points-at HEAD) ifeq ($(PKG_TAG),) diff --git a/deployment/docker/Makefile b/deployment/docker/Makefile index 676f3186e..818c7da9a 100644 --- a/deployment/docker/Makefile +++ b/deployment/docker/Makefile @@ -77,7 +77,7 @@ publish-via-docker: \ --build-arg root_image=$(ROOT_IMAGE) \ --build-arg APP_NAME=$(APP_NAME) \ --tag $(DOCKER_NAMESPACE)/$(APP_NAME):$(PKG_TAG)$(RACE) \ - --tag $(DOCKER_NAMESPACE)/$(APP_NAME):latest$(RACE) \ + --tag $(DOCKER_NAMESPACE)/$(APP_NAME):$(LATEST_TAG)$(RACE) \ -o type=image \ -f app/$(APP_NAME)/multiarch/Dockerfile \ --push \