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:
parent
b6531e0b98
commit
442fccdbcd
2 changed files with 40 additions and 1 deletions
39
.github/workflows/image.yaml
vendored
Normal file
39
.github/workflows/image.yaml
vendored
Normal 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
|
2
Makefile
2
Makefile
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in a new issue