Skip to content

Commit

Permalink
fix: keep IMAGE_NAME and set it once (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoceppi authored Mar 2, 2023
1 parent a5fde3b commit 85b152e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
- '**.md'
- '**.txt'
env:
IMAGE_NAME: main
IMAGE_BASE_NAME: main
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}

jobs:
Expand Down Expand Up @@ -48,6 +48,10 @@ jobs:
- name: Checkout Push to Registry action
uses: actions/checkout@v3

- name: Matrix Variables
run: |
echo "IMAGE_NAME=${{ format('{0}-{1}', matrix.image_name, env.IMAGE_BASE_NAME) }}" >> $GITHUB_ENV
- name: Generate tags
id: generate-tags
shell: bash
Expand Down Expand Up @@ -96,10 +100,10 @@ jobs:
id: meta
with:
images: |
${{ format('{0}-main', matrix.image_name) }}
$IMAGE_NAME
labels: |
org.opencontainers.image.title=${{ format('{0}-main', matrix.image_name) }}
org.opencontainers.image.description=A base ${{ matrix.image_name }} image with batteries included
org.opencontainers.image.title=$IMAGE_NAME
org.opencontainers.image.description=A base $IMAGE_NAME image with batteries included
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/ublue-os/main/main/README.md
io.artifacthub.package.logo-url=https://avatars.githubusercontent.com/u/120078124?s=200&v=4
Expand All @@ -110,7 +114,7 @@ jobs:
with:
containerfiles: |
./Containerfile
image: ${{ format('{0}-main', matrix.image_name) }}
image: ${{ env.IMAGE_NAME }}
tags: |
${{ steps.generate-tags.outputs.alias_tags }}
build-args: |
Expand Down

0 comments on commit 85b152e

Please sign in to comment.