build: nightly builds at 2:48am (#3490)

This commit is contained in:
Michal Kralik 2022-12-17 01:46:24 +01:00 committed by GitHub
parent e40c7d6efa
commit 07e9322157
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 1 deletions

24
.github/workflows/nightly-build.yml vendored Normal file
View file

@ -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

View file

@ -3,6 +3,7 @@ PKG_PREFIX := github.com/VictoriaMetrics/VictoriaMetrics
DATEINFO_TAG ?= $(shell date -u +'%Y%m%d-%H%M%S') DATEINFO_TAG ?= $(shell date -u +'%Y%m%d-%H%M%S')
BUILDINFO_TAG ?= $(shell echo $$(git describe --long --all | tr '/' '-')$$( \ 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))) 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) PKG_TAG ?= $(shell git tag -l --points-at HEAD)
ifeq ($(PKG_TAG),) ifeq ($(PKG_TAG),)

View file

@ -77,7 +77,7 @@ publish-via-docker: \
--build-arg root_image=$(ROOT_IMAGE) \ --build-arg root_image=$(ROOT_IMAGE) \
--build-arg APP_NAME=$(APP_NAME) \ --build-arg APP_NAME=$(APP_NAME) \
--tag $(DOCKER_NAMESPACE)/$(APP_NAME):$(PKG_TAG)$(RACE) \ --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 \ -o type=image \
-f app/$(APP_NAME)/multiarch/Dockerfile \ -f app/$(APP_NAME)/multiarch/Dockerfile \
--push \ --push \