Remove ubi8 workflows, add job to build udi9 (#192) #106
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
name: Build of UBI 9 based Developer Images | |
on: | |
push: | |
branches: [ main ] | |
workflow_call: | |
# Map the workflow outputs to job outputs | |
secrets: | |
QUAY_USERNAME: | |
required: true | |
QUAY_PASSWORD: | |
required: true | |
outputs: | |
uniq_tag: | |
description: "The first output string" | |
value: ${{ jobs.build_universal_ubi9_image.outputs.output1 }} | |
jobs: | |
build_base_ubi9_image: | |
name: Build and publish base ubi9 image to Quay.io | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Free runner space | |
run: | | |
sudo rm -rf /usr/local/lib/android | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
quay.io/devfile/base-developer-image | |
flavor: | | |
latest=true | |
prefix=ubi9-,onlatest=true | |
tags: | | |
type=sha,prefix=ubi9-,format=short | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Quay.io | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: Docker Build & Push Base | |
uses: docker/build-push-action@v6 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
provenance: false | |
context: base/ubi9 | |
platforms: linux/amd64, linux/arm64 | |
tags: | | |
quay.io/devfile/base-developer-image:latest | |
${{ steps.meta.outputs.tags }} | |
build_universal_ubi9_image: | |
name: Build and publish universal ubi9 image to Quay.io | |
runs-on: ubuntu-22.04 | |
needs: build_base_ubi9_image | |
# job output for passing to mapping value (the workflow_call section) | |
outputs: | |
output1: ${{ steps.setTagName.outputs.uniq_tag }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Free runner space | |
run: | | |
sudo rm -rf /usr/local/lib/android | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
quay.io/devfile/universal-developer-image | |
flavor: | | |
latest=true | |
prefix=ubi9-,onlatest=true | |
tags: | | |
type=sha,prefix=ubi9-,format=short | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Quay.io | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: Docker Build & Push Universal | |
uses: docker/build-push-action@v6 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
provenance: false | |
context: universal/ubi9 | |
tags: | | |
quay.io/devfile/universal-developer-image:latest | |
${{ steps.meta.outputs.tags }} | |
- name: Get tag with uniq prefix | |
id: setTagName | |
# set the image with uniq tag prefix (for example: quay.io/..../base-developer-image:ubi9-7ad6cab) to env. var | |
# and define it for output. This output with tag image will be used in caller job | |
run: | | |
UNIQ_TAG_IMAGE=$(echo $DOCKER_METADATA_OUTPUT_JSON | jq .tags[0]) | |
echo "...................$UNIQ_TAG_IMAGE" | |
echo "uniq_tag=$UNIQ_TAG_IMAGE" >> $GITHUB_OUTPUT |