feat: build latest version

Build and push the latest edge version to the registry.

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
This commit is contained in:
Serge Logvinov
2023-04-05 21:20:21 +03:00
parent 7a039d9f13
commit 11e77e8f83
2 changed files with 39 additions and 0 deletions

37
.github/workflows/build-edge.yaml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: Build edge
on:
push:
branches:
- main
paths:
- 'go.mod'
- 'go.sum'
- 'cmd/**'
- 'pkg/**'
jobs:
build-publish:
name: "Build image and publish"
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up docker buildx
run: make docker-init
- name: Github registry login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: make images
env:
PUSH: "true"
TAG: "edge"

View File

@@ -7,7 +7,9 @@ PUSH ?= false
SHA ?= $(shell git describe --match=none --always --abbrev=8 --dirty) SHA ?= $(shell git describe --match=none --always --abbrev=8 --dirty)
TAG ?= $(shell git describe --tag --always --match v[0-9]\*) TAG ?= $(shell git describe --tag --always --match v[0-9]\*)
ifneq ($(TAG),edge)
GO_LDFLAGS ?= -ldflags '-X k8s.io/component-base/version.gitVersion=$(TAG)' GO_LDFLAGS ?= -ldflags '-X k8s.io/component-base/version.gitVersion=$(TAG)'
endif
OS ?= $(shell go env GOOS) OS ?= $(shell go env GOOS)
ARCH ?= $(shell go env GOARCH) ARCH ?= $(shell go env GOARCH)