From 07e93221570620e8473e47b9ec7643c472d18b2b Mon Sep 17 00:00:00 2001 From: Michal Kralik Date: Sat, 17 Dec 2022 01:46:24 +0100 Subject: [PATCH] build: nightly builds at 2:48am (#3490) --- .github/workflows/nightly-build.yml | 24 ++++++++++++++++++++++++ Makefile | 1 + deployment/docker/Makefile | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/nightly-build.yml 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 \