Skip to content

Commit

Permalink
[INTERNAL] Publish to ghr
Browse files Browse the repository at this point in the history
  • Loading branch information
amuraru committed May 5, 2023
1 parent 22c95d6 commit 06433c7
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 173 deletions.
80 changes: 37 additions & 43 deletions .github/workflows/docker-image.yaml
Original file line number Diff line number Diff line change
@@ -1,62 +1,56 @@
name: Build Docker image
name: docker-image-push

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
tags:
- '*'
branches:
- "master"
paths-ignore:
- 'charts/**'
tags: [ '*' ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: adobe/kminion

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Checkout repository
uses: actions/checkout@v3
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
driver-opts: image=moby/buildkit:v0.10.3,network=host

registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Release Date
run: |
echo "BUILT_AT=$(date --rfc-3339=date)" >> ${GITHUB_ENV}
- name: Docker meta
id: docker_meta
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
vectorized/kminion
redpandadata/kminion
# generate Docker tags based on the following events/attributes
# Semver type is only active on 'push tag' events, hence no enable condition required
tags: |
type=sha,prefix={{branch}}-,format=short,enable={{is_default_branch}}
type=semver,pattern={{raw}}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and push
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.docker_meta.outputs.tags }}
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ fromJSON(steps.docker_meta.outputs.json).labels['org.opencontainers.image.version'] }}
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
BUILT_AT=${{ env.BUILT_AT }}
COMMIT=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
32 changes: 0 additions & 32 deletions .github/workflows/go-releaser.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/kics-iac.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/package-helm-chart-on-push.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/snyk-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ jobs:
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: |
snyk monitor --project-name=kminion --remote-repo=redpanda-data/kminion --target-reference=${GITHUB_REF#refs/heads/} .
shell: bash
snyk monitor --project-name=kminion --remote-repo=adobe/kminion --target-reference=${GITHUB_REF#refs/heads/} .
shell: bash
38 changes: 0 additions & 38 deletions .goreleaser.yml

This file was deleted.

0 comments on commit 06433c7

Please sign in to comment.