Skip to content

Github Action fix?

Github Action fix? #8

name: Build AI Toolbox image for benchmarking and debugging
on:
push:
branches:
- master
schedule:
- cron: '0 0 */7 * *'
workflow_dispatch: {}
env:
REGISTRY_USER: aleskandrox
IMAGE_REGISTRY: quay.io
IMAGE_NAME: aitools
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
jobs:
build-ai-toolbox-image:
runs-on: ubuntu-latest
name: Build and Push AI toolbox image
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Buildah configuration
run: |
export STORAGE_DRIVER=overlay
export STORAGE_ROOT=/mnt/containers/storage
sudo mkdir -p "$STORAGE_ROOT"
sudo chown -R "$(id -u):$(id -g)" "$STORAGE_ROOT"
echo "STORAGE_DRIVER=$STORAGE_DRIVER" >> $GITHUB_ENV
echo "STORAGE_ROOT=$STORAGE_ROOT" >> $GITHUB_ENV
df -h
- name: Set versioned tag
id: versioned-tag
run: |
VERSIONED_TAG=$(date -u --iso-8601=minutes | sed 's/://g;s/+.*$//')-${GITHUB_SHA}
echo "VERSIONED_TAG=${VERSIONED_TAG}" >> $GITHUB_OUTPUT
- name: Build image
uses: redhat-actions/buildah-build@v2
id: build-image
with:
image: ${{ env.IMAGE_REGISTRY }}/${{ env.REGISTRY_USER }}/${{ env.IMAGE_NAME }}
oci: true
layers: true
tags: latest ${{ steps.versioned-tag.outputs.VERSIONED_TAG }}
containerfiles: |
./ai_toolbox.Containerfile
- name: Push to registry
uses: redhat-actions/push-to-registry@v2
with:
tags: >-
${{ env.IMAGE_REGISTRY }}/${{ env.REGISTRY_USER }}/${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_REGISTRY }}/${{ env.REGISTRY_USER }}/${{ env.IMAGE_NAME }}:${{ steps.versioned-tag.outputs.VERSIONED_TAG }}
username: ${{ env.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}