bromite-buildtools/images/bromite-build/action.yaml

35 lines
1.1 KiB
YAML
Raw Normal View History

2021-07-10 12:59:39 +05:30
name: 'Prepare Bromite Builder Image'
description: 'Check and build Bromite builder image by sha'
inputs:
sha:
description: 'Bromite sha ref'
required: true
runs:
using: "composite"
steps:
- name: Checking image for "${{ inputs.sha }}"
shell: bash
run: |
BROMITE_SHA="${{ inputs.sha }}"
2021-07-11 16:09:16 +05:30
IS_PRESENT=$(docker inspect --type=image uazo/bromite-build:$BROMITE_SHA > /dev/null ; echo $?)
2021-07-10 12:59:39 +05:30
if [ $IS_PRESENT -ne "0" ]; then
2021-07-11 16:09:16 +05:30
IS_PRESENT=$(docker manifest inspect uazo/bromite-build:$BROMITE_SHA > /dev/null ; echo $?)
if [ $IS_PRESENT -ne "0" ]; then
echo "Image not found"
2021-07-10 12:59:39 +05:30
2021-07-11 16:09:16 +05:30
mkdir bromite-source
pushd bromite-source/
git clone https://github.com/uazo/bromite-buildtools
2021-07-10 12:59:39 +05:30
2021-07-11 16:09:16 +05:30
cd bromite-buildtools/images/bromite-build/
DOCKER_BUILDKIT=1 docker build -t uazo/bromite-build:$BROMITE_SHA --progress plain \
--build-arg BROMITE_SHA=$BROMITE_SHA \
.
2021-07-10 12:59:39 +05:30
2021-07-11 16:09:16 +05:30
popd
fi
2021-07-10 12:59:39 +05:30
fi