Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
fix(ci): Support cases where 'main' isn't used as flavor
Browse files Browse the repository at this point in the history
  • Loading branch information
EyeCantCU committed Sep 20, 2023
1 parent d3bf994 commit 20902c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
image_flavor: [main, nvidia]
image_flavor: [-main, -nvidia]
base_name: [surface]
base_image_name: [silverblue, kinoite, vauxite, sericea, base, lxqt, mate, bazzite, bazzite-gnome]
major_version: [38]
Expand All @@ -44,7 +44,10 @@ jobs:
- name: Matrix Variables
run: |
echo "BASE_IMAGE_NAME=${{ matrix.base_image_name }}" >> $GITHUB_ENV
if [[ "${{ matrix.base_image_name }}" == "main" ]]; then
if ! [[ "${{ matrix.base_image_name }}" =~ "bazzite" && "${{ matrix.image_flavor }}" =~ "main" ]]; then
echo "IMAGE_FLAVOR=${{ matrix.image_flavor }}" >> $GITHUB_ENV
fi
if [[ "${{ matrix.image_flavor }}" =~ "main" ]]; then
echo "IMAGE_NAME=${{ format('{0}-{1}', matrix.base_image_name, matrix.base_name) }}" >> $GITHUB_ENV
else
echo "IMAGE_NAME=${{ format('{0}-{1}-{2}', matrix.base_image_name, matrix.base_name, matrix.image_flavor) }}" >> $GITHUB_ENV
Expand Down Expand Up @@ -120,7 +123,7 @@ jobs:
tags: |
${{ steps.generate-tags.outputs.alias_tags }}
build-args: |
IMAGE_FLAVOR=${{ matrix.image_flavor }}
IMAGE_FLAVOR=${{ env.IMAGE_FLAVOR }}
BASE_IMAGE_NAME=${{ matrix.base_image_name }}
FEDORA_MAJOR_VERSION=${{ matrix.major_version }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME:-silverblue}"
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR}:-main"
ARG SOURCE_IMAGE="${SOURCE_IMAGE:-${BASE_IMAGE_NAME}-${IMAGE_FLAVOR}}"
ARG SOURCE_IMAGE="${SOURCE_IMAGE:-${BASE_IMAGE_NAME}${IMAGE_FLAVOR}}"
ARG BASE_IMAGE="ghcr.io/ublue-os/${SOURCE_IMAGE}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-38}"

Expand Down

0 comments on commit 20902c5

Please sign in to comment.