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
36
.github/workflows/build_container.yml
vendored
36
.github/workflows/build_container.yml
vendored
|
|
@ -12,9 +12,7 @@ jobs:
|
|||
build-container:
|
||||
if: >
|
||||
github.event_name == 'push' ||
|
||||
github.event_name == 'issue_comment' ||
|
||||
( github.event_name == 'pull_request' &&
|
||||
contains(github.event.pull_request.labels.*.name, 'auto-test') )
|
||||
github.event_name == 'issue_comment'
|
||||
name: Build Container Image
|
||||
env:
|
||||
JOB_NAME: Build Container Image
|
||||
|
|
@ -23,6 +21,18 @@ jobs:
|
|||
contents: read
|
||||
packages: 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:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
|
@ -66,7 +76,7 @@ jobs:
|
|||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
ghcr.io/${{ github.repository }}
|
||||
ghcr.io/${{ github.repository }}${{ matrix.append && format('-{0}', matrix.append) }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
|
|
@ -79,10 +89,19 @@ jobs:
|
|||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
ghcr.io/${{ github.repository }}
|
||||
ghcr.io/${{ github.repository }}${{ matrix.append && format('-{0}', matrix.append) }}
|
||||
tags: |
|
||||
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
|
||||
id: build-image
|
||||
uses: redhat-actions/buildah-build@v2
|
||||
|
|
@ -90,6 +109,11 @@ jobs:
|
|||
containerfiles: Containerfile
|
||||
tags: ${{ steps.meta.outputs.tags || steps.meta_pr.outputs.tags }}
|
||||
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
|
||||
uses: redhat-actions/push-to-registry@v2
|
||||
|
|
@ -107,4 +131,4 @@ jobs:
|
|||
status: ${{ job.status }}
|
||||
context: ${{ env.JOB_NAME }}
|
||||
sha: ${{ env.sha }}
|
||||
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||
|
|
|
|||
|
|
@ -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 IMAGE_NAME="base"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue