Skip to content

Commit 4425202

Browse files
Merge pull request #1117 from Nordix/peppi-lotta/download-artifacts-to-allow-preparing-directories-for-image-building
🌱 Allow downloading artifacts to allow pre-preparing directories for image-building
2 parents 5295d8b + c59596b commit 4425202

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/container-image-build.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ on:
4141
description: "Architecture platforms for the image build (linux/amd64,linux/arm64, etc.)"
4242
type: string
4343
default: ""
44+
artifact-name:
45+
required: false
46+
description: "Name of an artifact to be downloaded. Setting this will set the downloaded artifact direcory as image building base."
47+
type: string
48+
default: ""
4449
secrets:
4550
QUAY_USERNAME:
4651
required: true
@@ -102,13 +107,21 @@ jobs:
102107
echo "IMAGE_TAGS=${IMAGE_TAGS}" >> "${GITHUB_ENV}"
103108
echo "IMAGE_VERSION=${IMAGE_VERSION}" >> "${GITHUB_ENV}"
104109
110+
- name: Download artifact
111+
id: download-artifact
112+
if: ${{ inputs.artifact-name }} != ""
113+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
114+
with:
115+
name: ${{ inputs.artifact-name }}
116+
path: /tmp/build-${{ inputs.image-name }}
117+
105118
- name: Build ${{ inputs.image-name }} image
106119
uses: mr-smithers-excellent/docker-build-push@19d2beefef6bcdc202195fdcb9deb79a4fab5c1f # v6.8
107120
with:
108121
image: metal3-io/${{ inputs.image-name }}
109122
tags: ${{ env.IMAGE_TAGS }}
110-
directory: ${{ inputs.dockerfile-directory }}
111-
dockerfile: ${{ inputs.dockerfile-directory }}/Dockerfile
123+
directory: ${{ steps.download-artifact.outputs.download-path || inputs.dockerfile-directory }}
124+
dockerfile: ${{ steps.download-artifact.outputs.download-path || inputs.dockerfile-directory }}/Dockerfile
112125
buildArgs: ${{ inputs.image-build-args || '' }}
113126
labels: |
114127
org.opencontainers.image.version=${{ env.IMAGE_VERSION }}

0 commit comments

Comments
 (0)