Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Commit

Permalink
fix: fix build arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
gerblesh committed Jul 21, 2023
1 parent d2c9823 commit 978bd61
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ jobs:
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/ublue-os/startingpoint/main/README.md
io.artifacthub.package.logo-url=https://avatars.githubusercontent.com/u/120078124?s=200&v=4
# Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR.
# https://github.com/macbre/push-to-ghcr/issues/12
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v5
with:
string: ${{ env.IMAGE_REGISTRY }}

# Build image using Buildah action
- name: Build Image
id: build_image
Expand All @@ -132,17 +140,10 @@ jobs:
FEDORA_MAJOR_VERSION=${{ env.FEDORA_MAJOR_VERSION }}
BASE_IMAGE_URL=${{ env.BASE_IMAGE_URL }}
RECIPE=${{ matrix.recipe }}
IMAGE_REGISTRY=${{ steps.registry_case.outputs.lowercase }}
labels: ${{ steps.meta.outputs.labels }}
oci: false

# Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR.
# https://github.com/macbre/push-to-ghcr/issues/12
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v5
with:
string: ${{ env.IMAGE_REGISTRY }}

# Push the image to GHCR (Image Registry)
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
Expand Down
8 changes: 6 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ FROM ${BASE_IMAGE_URL}:${FEDORA_MAJOR_VERSION}
# so that `podman build` should just work for many people.
ARG RECIPE=./recipe.yml

# The default image registry to write to policy.json and cosign.yaml
ARG IMAGE_REGISTRY=ghcr.io/ublue-os

# Copy static configurations and component files.
# Warning: If you want to place anything in "/etc" of the final image, you MUST
# place them in "./usr/etc" in your repo, so that they're written to "/usr/etc"
Expand All @@ -23,10 +26,11 @@ ARG RECIPE=./recipe.yml
# for manual overrides and editing by the machine's admin AFTER installation!
# See issue #28 (https://github.com/ublue-os/startingpoint/issues/28).
COPY usr /usr

# Copy public key
COPY ./cosign.pub /usr/etc/pki/containers/cosign.pub
COPY cosign.pub /usr/etc/pki/containers/cosign.pub
# Copy base signing config
COPY ./usr/etc/containers /usr/etc/
COPY usr/etc/containers /usr/etc/

# Copy the recipe that we're building.
COPY ${RECIPE} /usr/share/ublue-os/recipe.yml
Expand Down
1 change: 1 addition & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ echo "Building custom Fedora ${FEDORA_VERSION} from image: \"${BASE_IMAGE}\"."

# Setup container signing
echo "Setup container signing in policy.json and cosign.yaml"
echo "Registry to write: $IMAGE_REGISTRY"
sed -i "s ghcr.io/ublue-os $IMAGE_REGISTRY g" /usr/etc/containers/policy.json
sed -i "s ghcr.io/ublue-os $IMAGE_REGISTRY g" /usr/etc/containers/registries.d/cosign.yaml

Expand Down

0 comments on commit 978bd61

Please sign in to comment.