From 045a45d4d2c14451599dcd2887c3a161adae64d8 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Wed, 27 Jul 2022 09:25:09 +0200 Subject: [PATCH] fix(ci): add github workflow --- .github/dependabot.yml | 43 +++++++++++++++++++++++++++++ .github/workflows/build-latest.yaml | 41 +++++++++++++++++++++++++++ Makefile | 12 ++------ 3 files changed, 86 insertions(+), 10 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build-latest.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..706d202 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,43 @@ +version: 2 +registries: + orbis-registry: + type: docker-registry + url: ${{ secrets.REGISTRY_PULL_HOST }} + username: ${{ secrets.REGISTRY_PULL_USER }} + password: ${{ secrets.REGISTRY_PULL_PASSWORD }} +updates: + +# Maintain dependencies for docker +- package-ecosystem: "docker" + directory: "/" + registries: + - orbis-registry + schedule: + interval: "daily" + assignees: + - "volker-raschek" + labels: + - "dependabot" + - "dependabot/docker" + +# Maintain dependencies for GitHub Actions +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + assignees: + - "volker-raschek" + labels: + - "dependabot" + - "dependabot/github-actions" + +# Maintain dependencies for golang +- package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "daily" + assignees: + - "volker-raschek" + labels: + - "dependabot" + - "dependabot/gomod" diff --git a/.github/workflows/build-latest.yaml b/.github/workflows/build-latest.yaml new file mode 100644 index 0000000..6d3fde0 --- /dev/null +++ b/.github/workflows/build-latest.yaml @@ -0,0 +1,41 @@ +name: build-latest + +on: + push: + branches: + - master + pull_request: + types: [ opened, reopened ] + +env: + CONTAINER_RUNTIME: docker + +jobs: + cancel: + runs-on: + - ubuntu-22.04 + steps: + - name: cancel previous runs + uses: styfle/cancel-workflow-action@0.9.1 + with: + all_but_latest: true + access_token: ${{ github.token }} + + build-amd64-latest: + runs-on: + - ubuntu-22.04 + needs: + - cancel + steps: + - name: clone + uses: actions/checkout@v2 + - name: install build-essential + run: + apt update --yes && \ + apt upgrade --yes && \ + apt install --yes build-essential + - name: set up docker + uses: docker-practice/actions-setup-docker@master + - name: build + run: | + make container-image/build/amd64 \ No newline at end of file diff --git a/Makefile b/Makefile index a0957b0..9f7afa3 100644 --- a/Makefile +++ b/Makefile @@ -4,14 +4,6 @@ # VERSION?=$(shell git describe --abbrev=0)+hash.$(shell git rev-parse --short HEAD) VERSION?=0.0.0+hash.$(shell git rev-parse --short HEAD) -# GOPROXY settings -# If no GOPROXY environment variable available, the pre-defined GOPROXY from go -# env to download and validate go modules is used. Exclude downloading and -# validation of all private modules which are pre-defined in GOPRIVATE. If no -# GOPRIVATE variable defined, the variable of go env is used. -GOPROXY?=$(shell go env GOPROXY) -GOPRIVATE?=$(shell go env GOPRIVATE) - # EXECUTABLE # Executable binary which should be compiled for different architecures EXECUTABLE:=dhdu @@ -153,8 +145,8 @@ container-image/build/amd64: --build-arg BUILD_IMAGE=${BUILD_IMAGE_FULL} \ --build-arg EXECUTABLE=${EXECUTABLE} \ --build-arg EXECUTABLE_TARGET=bin/linux/amd64/${EXECUTABLE} \ - --build-arg GOPROXY=${GOPROXY} \ - --build-arg GOPRIVATE=${GOPRIVATE} \ + --build-arg GOPROXY \ + --build-arg GOPRIVATE \ --build-arg VERSION=${VERSION} \ --file Dockerfile \ --no-cache \