Skip to content

Commit

Permalink
[ci] rewire docker image metadata
Browse files Browse the repository at this point in the history
this should now also work if the repo name isn't all lowercase
  • Loading branch information
renefritze committed Apr 19, 2022
1 parent 17a6c14 commit 4e7c37e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: CI
on:
push:

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

jobs:
maven:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -38,9 +42,15 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# https://github.com/docker/metadata-action (lower cases image name, etc.)
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 4e7c37e

Please sign in to comment.