Publish image to GHCR

This commit is contained in:
CrazyMax
2020-11-01 00:23:22 +01:00
parent 67071ea11f
commit 9065660e58
2 changed files with 24 additions and 4 deletions

View File

@@ -84,6 +84,7 @@ jobs:
needs: go
env:
DOCKERHUB_SLUG: crazymax/diun
GHCR_SLUG: ghcr.io/crazy-max/diun
steps:
-
name: Checkout
@@ -93,7 +94,9 @@ jobs:
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ${{ env.DOCKERHUB_SLUG }}
images: |
${{ env.DOCKERHUB_SLUG }}
${{ env.GHCR_SLUG }}
tag-edge: true
tag-match: v(.*)
tag-match-group: 1
@@ -112,6 +115,14 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1.4.1
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
-
name: Build
uses: docker/build-push-action@v2
@@ -122,7 +133,7 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
build-args: |
VERSION=${{ steps.prep.outputs.version }}
VERSION=${{ steps.docker_meta.outputs.version }}
labels: |
${{ steps.docker_meta.outputs.labels }}
org.opencontainers.image.title=Diun
@@ -133,9 +144,12 @@ jobs:
if: github.event_name != 'pull_request'
run: |
docker buildx imagetools inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.docker_meta.outputs.version }}
docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:${{ steps.docker_meta.outputs.version }}
-
name: Inspect
name: Inspect image
if: github.event_name != 'pull_request'
run: |
docker pull ${{ env.DOCKERHUB_SLUG }}:${{ steps.docker_meta.outputs.version }}
docker image inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.docker_meta.outputs.version }}
docker pull ${{ env.GHCR_SLUG }}:${{ steps.docker_meta.outputs.version }}
docker image inspect ${{ env.GHCR_SLUG }}:${{ steps.docker_meta.outputs.version }}

View File

@@ -2,7 +2,13 @@
## About
Diun provides automatically updated Docker :whale: images within [Docker Hub](https://hub.docker.com/r/crazymax/diun).
Diun provides automatically updated Docker :whale: images within several registries:
| Registry | Image |
|--------------------------------------------------------------------------------------------------|---------------------------------|
| [Docker Hub](https://hub.docker.com/r/crazymax/diun/) | `crazymax/diun` |
| [GitHub Container Registry](https://github.com/users/crazy-max/packages/container/package/diun) | `ghcr.io/crazy-max/diun` |
It is possible to always use the latest stable tag or to use another service that handles updating Docker images.
Following platforms for this image are available: