mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
manually run docker
This commit is contained in:
parent
8b04f82012
commit
218bb28db1
5 changed files with 57 additions and 13 deletions
|
|
@ -17,8 +17,48 @@ env:
|
||||||
VARIANT: 'Server'
|
VARIANT: 'Server'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build-container:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
jasonn3/build-container-installer
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
|
||||||
|
- name: Buildah Build
|
||||||
|
id: build-image
|
||||||
|
uses: redhat-actions/buildah-build@v2
|
||||||
|
with:
|
||||||
|
containerfiles: Containerfile
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
|
||||||
|
- name: Push image
|
||||||
|
uses: redhat-actions/push-to-registry@v2
|
||||||
|
with:
|
||||||
|
image: ${{ steps.build-image.outputs.image }}
|
||||||
|
tags: ${{ steps.build-image.outputs.tags }}
|
||||||
|
registry: ghcr.io/jasonn3
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ github.token }}
|
||||||
|
|
||||||
|
|
||||||
build-and-push-iso:
|
build-and-push-iso:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- build-container
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
4
Makefile
4
Makefile
|
|
@ -56,8 +56,8 @@ boot.iso: lorax_templates/set_installer.tmpl lorax_templates/configure_upgrades.
|
||||||
mv $(_BASE_DIR)/results/images/boot.iso $(_BASE_DIR)/
|
mv $(_BASE_DIR)/results/images/boot.iso $(_BASE_DIR)/
|
||||||
|
|
||||||
# Step 3: Download container image
|
# Step 3: Download container image
|
||||||
container/$(IMAGE_NAME)-$(IMAGE_TAG):
|
build/container/$(IMAGE_NAME)-$(IMAGE_TAG):
|
||||||
mkdir container || true
|
mkdir build/container || true
|
||||||
podman pull $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
|
podman pull $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
|
||||||
podman save --format oci-dir -o $(_BASE_DIR)/container/$(IMAGE_NAME)-$(IMAGE_TAG) $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
|
podman save --format oci-dir -o $(_BASE_DIR)/container/$(IMAGE_NAME)-$(IMAGE_TAG) $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
|
||||||
podman rmi $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
|
podman rmi $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
|
||||||
|
|
|
||||||
24
action.yml
24
action.yml
|
|
@ -31,13 +31,17 @@ inputs:
|
||||||
default: "false"
|
default: "false"
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: docker
|
using: composite
|
||||||
image: 'Dockerfile'
|
steps:
|
||||||
args:
|
- name: Run docker image
|
||||||
- ARCH=${{ inputs.arch }}
|
shell: bash
|
||||||
- IMAGE_NAME=${{ inputs.image_name }}
|
run: |
|
||||||
- IMAGE_REPO=${{ inputs.image_repo }}
|
tag=$( echo ${{ github.ref_name }} | tr '/' ' ' | awk '{ print $1 }' )
|
||||||
- VARIANT=${{ inputs.variant }}
|
docker run --privileged --volume .:/github/workspace/ ghcr.io/jasonn3/build-container-image:${tag} \
|
||||||
- VERSION=${{ inputs.version }}
|
ARCH=${{ inputs.arch }} \
|
||||||
- IMAGE_TAG=${{ inputs.image_tag || inputs.version }}
|
IMAGE_NAME=${{ inputs.image_name }} \
|
||||||
- WEB_UI=${{ inputs.web_ui }}
|
IMAGE_REPO=${{ inputs.image_repo }} \
|
||||||
|
VARIANT=${{ inputs.variant }} \
|
||||||
|
VERSION=${{ inputs.version }} \
|
||||||
|
IMAGE_TAG=${{ inputs.image_tag || inputs.version }} \
|
||||||
|
WEB_UI=${{ inputs.web_ui }}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
make container/${IMAGE_NAME}-${IMAGE_TAG} $@
|
make build/container/${IMAGE_NAME}-${IMAGE_TAG} $@
|
||||||
|
|
||||||
make boot.iso $@
|
make boot.iso $@
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue