-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
278 additions
and
739 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: build_push_image | ||
|
||
inputs: | ||
image_name: | ||
required: true | ||
image_version: | ||
required: true | ||
image_registry: | ||
required: true | ||
image_description: | ||
required: true | ||
containerfiles: | ||
required: true | ||
arch_type: | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Maximize build space | ||
uses: easimon/maximize-build-space@v10 | ||
with: | ||
root-reserve-mb: 38000 | ||
remove-dotnet: 'true' | ||
remove-android: 'true' | ||
remove-haskell: 'true' | ||
remove-codeql: 'true' | ||
remove-docker-images: 'true' | ||
|
||
# Checkout push-to-registry action GitHub repository | ||
- name: Checkout Push to Registry action | ||
uses: actions/checkout@v4 | ||
|
||
# Build metadata | ||
- name: Image Metadata | ||
uses: docker/metadata-action@v5 | ||
id: meta | ||
with: | ||
images: | | ||
${{ inputs.image_name }} | ||
labels: | | ||
org.opencontainers.image.title= ${{ inputs.image_name }} | ||
org.opencontainers.image.version= ${{ inputs.image_version }} | ||
org.opencontainers.image.description= ${{inputs.image_description }} | ||
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/ryanabx/fedora-cosmic-atomic/main/README.md | ||
io.artifacthub.package.logo-url=https://avatars.githubusercontent.com/u/56272643?s=200&v=4 | ||
- name: Install qemu dependency | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y qemu-user-static | ||
# Build image using Buildah action | ||
- name: Build Image | ||
id: build_image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
containerfiles: | | ||
${{ inputs.containerfiles }} | ||
image: ${{ inputs.image_name }} | ||
archs: ${{ env.arch_type }} | ||
build-args: | | ||
IMAGE_MAJOR_VERSION= ${{ inputs.image_version }} | ||
IMAGE_REGISTRY= ${{ inputs.image_registry }} | ||
oci: false | ||
|
||
- name: 'Login to GitHub Container Registry' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{github.actor}} | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
|
||
# Push the image to GHCR (Image Registry) | ||
- name: Push To GHCR | ||
uses: redhat-actions/push-to-registry@v2 | ||
id: push | ||
with: | ||
image: ${{ steps.build_image.outputs.image }} | ||
tags: ${{ steps.build_image.outputs.tags }} | ||
registry: ${{ inputs.image_registry }} | ||
extra-args: | | ||
--disable-content-trust |
Oops, something went wrong.