Skip to content

Commit

Permalink
migrate to ghcr.io (#116)
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Hopfensperger <f.hopfensperger@gmail.com>
  • Loading branch information
fhopfensperger authored Apr 6, 2023
1 parent 5ffed52 commit ece5011
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 31 deletions.
17 changes: 6 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
- package-ecosystem: docker
directory: "/"
schedule:
interval: daily
time: "04:00"
- package-ecosystem: "gomod"
directory: "/"
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: "docker"
directory: "/"
42 changes: 25 additions & 17 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set release version
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -72,24 +72,32 @@ jobs:
- name: Set up QEMU
if: startsWith(github.ref, 'refs/tags/')
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
if: startsWith(github.ref, 'refs/tags/')
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Build and push container image
- name: Login to GHCR
if: startsWith(github.ref, 'refs/tags/')
env:
QUAY_USER: ${{ secrets.QUAY_USER }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
run: |
docker login -u=$QUAY_USER -p=$QUAY_TOKEN quay.io
docker buildx build \
--platform linux/arm/v7,linux/amd64,linux/arm64 \
--tag quay.io/fhopfensperger/git-remote-cleanup:latest \
--tag quay.io/fhopfensperger/git-remote-cleanup:$RELEASE_VERSION_WITHOUT_V \
-f Dockerfile \
--build-arg BUILD_VERSION=$RELEASE_VERSION_WITHOUT_V \
--push .
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args: |
BUILD_VERSION=${{ env.RELEASE_VERSION_WITHOUT_V }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION_WITHOUT_V }}
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/fhopfensperger/git-remote-cleanup)](https://goreportcard.com/report/github.com/fhopfensperger/git-remote-cleanup)
[![Coverage Status](https://coveralls.io/repos/github/fhopfensperger/git-remote-cleanup/badge.svg?branch=master)](https://coveralls.io/github/fhopfensperger/git-remote-cleanup?branch=master)
[![Release](https://img.shields.io/github/release/fhopfensperger/git-remote-cleanup.svg?style=flat-square)](https://github.com//fhopfensperger/git-remote-cleanup/releases/latest)
[![Docker Repository on Quay](https://img.shields.io/badge/Quay-repository-sucess "Docker Repository on Quay")](https://quay.io/repository/fhopfensperger/git-remote-cleanup)


Get and delete no longer needed release branches from a remote repository.
Expand Down Expand Up @@ -64,8 +63,8 @@ sudo mv git-remote-cleanup /usr/local/bin/
Besides installing the binary on the local computer, you have the option to run the program as a container
```bash
# Using a single repo
docker run -it --rm quay.io/fhopfensperger/git-remote-cleanup branches -r https://github.com/fhopfensperger/git-remote-cleanup.git -b master -p 123
docker run -it --rm ghcr.io/fhopfensperger/git-remote-cleanup branches -r https://github.com/fhopfensperger/git-remote-cleanup.git -b master -p 123

# Using a file to define multiple repos
docker run -it --rm -v $(pwd)/repos_http.txt:/app/repos_http.txt quay.io/fhopfensperger/git-remote-cleanup branches -f repos_http.txt -b master -p 123
docker run -it --rm -v $(pwd)/repos_http.txt:/app/repos_http.txt ghcr.io/fhopfensperger/git-remote-cleanup branches -f repos_http.txt -b master -p 123
```

0 comments on commit ece5011

Please sign in to comment.