1
0
Fork 0
mirror of https://github.com/kyverno/policy-reporter.git synced 2024-12-14 11:57:32 +00:00

Add Image workflow

This commit is contained in:
fjogeleit 2021-09-25 10:53:22 +02:00
parent b6531e0b98
commit 442fccdbcd
2 changed files with 40 additions and 1 deletions

39
.github/workflows/image.yaml vendored Normal file
View file

@ -0,0 +1,39 @@
name: image
on:
push:
tags:
- v*
jobs:
push-policy-reporter:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Push image
id: params
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
echo VERSION=$VERSION
echo "::set-output name=version::$VERSION"
- name: login to GitHub Container Registry
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
id: buildx
with:
install: true
version: latest
- name: docker images publish
run: |
make IMAGE_TAG="${{ steps.params.outputs.version }}" docker-push

View file

@ -1,6 +1,6 @@
GO ?= go
BUILD ?= build
REPO ?= fjogeleit/policy-reporter
REPO ?= ghcr.io/kyverno/policy-reporter
IMAGE_TAG ?= 1.8.6
LD_FLAGS="-s -w"