Skip to content

Commit

Permalink
Replace dockerhub with ghcr.io (#35)
Browse files Browse the repository at this point in the history
* Update dependencies

* Add lint workflow and fix issues

* Replace Travis with GH actions

* Update K8s deps

* Add docker build to ghcr.io

* Replace dockerhub with ghcr.io
  • Loading branch information
coufalja authored Apr 24, 2023
1 parent 33fc282 commit 2fa376b
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 10 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- "v*.*.*"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TAG: ${{ github.ref_name }}

jobs:
Expand Down Expand Up @@ -36,3 +38,39 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: git2kube-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz

release-docker-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker build & push
uses: docker/build-push-action@v4
with:
push: true
context: .
build-args: |
VERSION=${{ github.ref_name }}
tags: ${{ steps.meta.outputs.tags }}

11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# git2kube - From Git to Kubernetes
[![Build Status](https://travis-ci.org/wandera/git2kube.svg?branch=master)](https://travis-ci.org/wandera/git2kube)
[![Docker Build Status](https://img.shields.io/docker/build/wanderadock/git2kube.svg)](https://hub.docker.com/r/wanderadock/git2kube/)

[![Test](https://github.com/wandera/git2kube/actions/workflows/test.yml/badge.svg)](https://github.com/wandera/git2kube/actions/workflows/test.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/wandera/git2kube)](https://goreportcard.com/report/github.com/wandera/git2kube)
[![GitHub release](https://img.shields.io/github/release/wandera/git2kube.svg)](https://github.com/wandera/git2kube/releases/latest)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/wandera/scccmd/blob/master/LICENSE)
Expand All @@ -21,14 +20,12 @@ Tool for syncing git with Kubernetes.
Check out [example](example) folder that should get you started.

### Docker repository
The tool is released as docker image as well, check the [repository](https://hub.docker.com/r/wanderadock/git2kube/).
The tool is released as docker image as well, check the [repository](https://github.com/wandera/git2kube/pkgs/container/git2kube).

### Documentation
* [docs](docs/git2kube.md) - Generated documentation for the tool
* [example](example) - Kubernetes deployment examples

### How to develop
* Checkout into your GOROOT directory (e.g. /go/src/github.com/wandera/git2kube)
* `cd` into the folder and run `dep ensure --vendor-only`
* Tests are started by `go test -v ./...`
* Or if you dont want to setup your local go env just use the provided Dockerfile
* Or if you dont want to setup your local go env just use the provided Dockerfile
2 changes: 1 addition & 1 deletion example/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ spec:
serviceAccountName: git2kube-watcher
containers:
- name: git2kube-prometheus-rules
image: wanderadock/git2kube
image: ghcr.io/wandera/git2kube
args:
- 'load'
- 'configmap'
Expand Down
2 changes: 1 addition & 1 deletion example/sidecar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
name: rules
readOnly: true
- name: git2kube-prometheus-rules
image: wanderadock/git2kube
image: ghcr.io/wandera/git2kube
args:
- 'watch'
- 'folder'
Expand Down
2 changes: 1 addition & 1 deletion example/watcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ spec:
serviceAccountName: git2kube-watcher
containers:
- name: git2kube-prometheus-rules
image: wanderadock/git2kube
image: ghcr.io/wandera/git2kube
args:
- 'watch'
- 'configmap'
Expand Down

0 comments on commit 2fa376b

Please sign in to comment.