mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
add ubi
This commit is contained in:
parent
fadeb6fffb
commit
ceccf8278d
2 changed files with 34 additions and 8 deletions
34
.github/workflows/build_container.yml
vendored
34
.github/workflows/build_container.yml
vendored
|
|
@ -12,9 +12,7 @@ jobs:
|
||||||
build-container:
|
build-container:
|
||||||
if: >
|
if: >
|
||||||
github.event_name == 'push' ||
|
github.event_name == 'push' ||
|
||||||
github.event_name == 'issue_comment' ||
|
github.event_name == 'issue_comment'
|
||||||
( github.event_name == 'pull_request' &&
|
|
||||||
contains(github.event.pull_request.labels.*.name, 'auto-test') )
|
|
||||||
name: Build Container Image
|
name: Build Container Image
|
||||||
env:
|
env:
|
||||||
JOB_NAME: Build Container Image
|
JOB_NAME: Build Container Image
|
||||||
|
|
@ -23,6 +21,18 @@ jobs:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
statuses: write
|
statuses: write
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- registry.fedoraproject.org/fedora
|
||||||
|
- registry.access.redhat.com/ubi8/ubi
|
||||||
|
include:
|
||||||
|
- os: registry.fedoraproject.org/fedora
|
||||||
|
tag: 39
|
||||||
|
- os: registry.access.redhat.com/ubi8/ubi
|
||||||
|
tag: latest
|
||||||
|
append: ubi
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -66,7 +76,7 @@ jobs:
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
ghcr.io/${{ github.repository }}
|
ghcr.io/${{ github.repository }}${{ matrix.append && format('-{0}', matrix.append) }}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
|
|
@ -79,10 +89,19 @@ jobs:
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
ghcr.io/${{ github.repository }}
|
ghcr.io/${{ github.repository }}${{ matrix.append && format('-{0}', matrix.append) }}
|
||||||
tags: |
|
tags: |
|
||||||
pr-${{ inputs.pr }}
|
pr-${{ inputs.pr }}
|
||||||
|
|
||||||
|
- name: Get UBI Subs
|
||||||
|
if: matrix.append == 'ubi'
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: ${{ secrets.RH_REPO }}
|
||||||
|
token: ${{ secrets.RH_ENT }}
|
||||||
|
persist-credentials: false
|
||||||
|
path: ubi
|
||||||
|
|
||||||
- name: Buildah Build
|
- name: Buildah Build
|
||||||
id: build-image
|
id: build-image
|
||||||
uses: redhat-actions/buildah-build@v2
|
uses: redhat-actions/buildah-build@v2
|
||||||
|
|
@ -90,6 +109,11 @@ jobs:
|
||||||
containerfiles: Containerfile
|
containerfiles: Containerfile
|
||||||
tags: ${{ steps.meta.outputs.tags || steps.meta_pr.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags || steps.meta_pr.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels || steps.meta_pr.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels || steps.meta_pr.outputs.labels }}
|
||||||
|
build-args: |
|
||||||
|
BASE_IMAGE=${{ matrix.os }}
|
||||||
|
IMAGE_VERSION=${{ matrix.tag }}
|
||||||
|
extra-args: |
|
||||||
|
${{ matrix.append == 'ubi' && '--volume=./ubi:/etc/pki/entitlement-host' }}
|
||||||
|
|
||||||
- name: Push image
|
- name: Push image
|
||||||
uses: redhat-actions/push-to-registry@v2
|
uses: redhat-actions/push-to-registry@v2
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
FROM fedora:40
|
ARG BASE_IMAGE
|
||||||
|
ARG IMAGE_VERSION
|
||||||
|
FROM ${BASE_IMAGE}:${IMAGE_VERSION}
|
||||||
|
|
||||||
ARG VERSION=40
|
ARG VERSION=39
|
||||||
|
|
||||||
ENV ARCH="x86_64"
|
ENV ARCH="x86_64"
|
||||||
ENV IMAGE_NAME="base"
|
ENV IMAGE_NAME="base"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue