From 2fa376bf4334c152efad5b38d9398df80b7feead Mon Sep 17 00:00:00 2001 From: Jakub Coufal Date: Mon, 24 Apr 2023 13:40:24 +0200 Subject: [PATCH] Replace dockerhub with ghcr.io (#35) * 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 --- .github/workflows/release.yml | 38 +++++++++++++++++++++++++++++++++++ README.md | 11 ++++------ example/cronjob.yaml | 2 +- example/sidecar.yaml | 2 +- example/watcher.yaml | 2 +- 5 files changed, 45 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f169f2..1803d03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,8 @@ on: - "v*.*.*" env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} TAG: ${{ github.ref_name }} jobs: @@ -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 }} + diff --git a/README.md b/README.md index e04a27b..f011731 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 \ No newline at end of file +* Or if you dont want to setup your local go env just use the provided Dockerfile diff --git a/example/cronjob.yaml b/example/cronjob.yaml index de7ba17..022db94 100644 --- a/example/cronjob.yaml +++ b/example/cronjob.yaml @@ -69,7 +69,7 @@ spec: serviceAccountName: git2kube-watcher containers: - name: git2kube-prometheus-rules - image: wanderadock/git2kube + image: ghcr.io/wandera/git2kube args: - 'load' - 'configmap' diff --git a/example/sidecar.yaml b/example/sidecar.yaml index 4c19dbd..8e354ad 100644 --- a/example/sidecar.yaml +++ b/example/sidecar.yaml @@ -28,7 +28,7 @@ spec: name: rules readOnly: true - name: git2kube-prometheus-rules - image: wanderadock/git2kube + image: ghcr.io/wandera/git2kube args: - 'watch' - 'folder' diff --git a/example/watcher.yaml b/example/watcher.yaml index 62e9c5f..ea86f6f 100644 --- a/example/watcher.yaml +++ b/example/watcher.yaml @@ -67,7 +67,7 @@ spec: serviceAccountName: git2kube-watcher containers: - name: git2kube-prometheus-rules - image: wanderadock/git2kube + image: ghcr.io/wandera/git2kube args: - 'watch' - 'configmap'