Skip to content

Commit

Permalink
feat: Use variables more extensively in build workflow (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-stone committed Mar 4, 2023
1 parent 3a6a268 commit c9737c2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:

env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}

jobs:
push-ghcr:
name: Build and push image
Expand Down Expand Up @@ -56,6 +55,10 @@ jobs:
- name: Checkout Push to Registry action
uses: actions/checkout@v3

- name: Matrix Variables
run: |
REPO=${{ github.repository }}
echo "IMAGE_NAME=${{ matrix.image_name }}-${REPO##*/}" >> $GITHUB_ENV
- name: Generate tags
id: generate-tags
shell: bash
Expand Down Expand Up @@ -133,11 +136,11 @@ jobs:
id: meta
with:
images: |
${{ format('{0}-nvidia', matrix.image_name) }}
$IMAGE_NAME
labels: |
org.opencontainers.image.title=${{ format('{0}-nvidia', matrix.image_name) }}
org.opencontainers.image.description=Vanilla ${{ matrix.image_name }} with Nvidia drivers added
io.artifacthub.package.readme-url=https://github.com/raw/ublue-os/nvidia/main/README.md
org.opencontainers.image.title=$IMAGE_NAME
org.opencontainers.image.description=ublue-os $IMAGE_NAME with Nvidia drivers added
io.artifacthub.package.readme-url=https://github.com/raw/${{ github.repository }}/main/README.md
io.artifacthub.package.logo-url=https://github.com/avatars/u/1728152?s=200&v=4
# Build image using Buildah action
- name: Build Image
Expand All @@ -146,9 +149,7 @@ jobs:
with:
containerfiles: |
./Containerfile
# Postfix image name with -nvidia to make it a little more descriptive
# Syntax: https://docs.github.com/en/actions/learn-github-actions/expressions#format
image: ${{ format('{0}-nvidia', matrix.image_name) }}
image: ${{ env.IMAGE_NAME }}
tags: |
${{ steps.generate-tags.outputs.alias_tags }}
build-args: |
Expand Down

0 comments on commit c9737c2

Please sign in to comment.