Skip to content

Commit

Permalink
feat(docker): publish image to GHCR as well as Hub (#1081)
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Joliveau <matteojoliveau@gmail.com>
  • Loading branch information
MatteoJoliveau committed Apr 26, 2022
1 parent 24231a9 commit c264f28
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,31 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Set Tag Variable
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Login to GHCR
uses: docker/login-action@v1
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v3
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')
with:
images: |
tchiotludo/akhq
ghcr.io/${{ github.repository }}
- name: Publish to Docker Hub
- name: Publish to registries
uses: docker/build-push-action@v2
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')
with:
push: true
context: .
tags: tchiotludo/akhq:${{ steps.vars.outputs.tag }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64

# Slack
Expand Down

0 comments on commit c264f28

Please sign in to comment.