Skip to content

update build workflow to use reuseable workflow #58

update build workflow to use reuseable workflow

update build workflow to use reuseable workflow #58

name: Build the LLM Finetuning Docker image
on:
push:
tags:
- v*
branches:
- update-workflow
permissions:
id-token: write
contents: read
concurrency:
group: build-llm-finetune-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_SHA: ${{ github.sha }}
TAG_PREFIX: "v"
jobs:
build_image:
name: Build Image
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: false
- name: Set version tags
run: |
echo "Ref name is ${{ github.ref_name }}"
echo "TAG_PREFIX is ${{ env.TAG_PREFIX }}"
REF_NAME=${{ github.ref_name }}
TAG_PREFIX=${{ env.TAG_PREFIX }}
VERSION_TAG=$(echo $REF_NAME | cut -d $TAG_PREFIX -f 2-)
echo "Setting VERSION_TAG equal to $VERSION_TAG"
echo "VERSION_TAG=$VERSION_TAG" >> $GITHUB_ENV
ALT_VERSION_TAG=$(echo $VERSION_TAG | awk -F- '{print $1}')-${GITHUB_SHA::7}
echo "Setting ALT_VERSION_TAG equal to $ALT_VERSION_TAG"
echo "ALT_VERSION_TAG=$ALT_VERSION_TAG" >> $GITHUB_ENV
- name: Build and Push llm-finetune image
uses: truefoundry/workflows/.github/workflows/[email protected]
with:
image_tag: ${{ github.sha }}
extra_image_tag: |
${{ env.VERSION_TAG }}
${{ env.ALT_VERSION_TAG }}
platforms: linux/amd64
image_artifact_name: ${{ github.event.repository.name }}
artifactory_registry_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_REGISTRY_URL }}
artifactory_repository_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_REPOSITORY }}
secrets:
artifactory_username: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_USERNAME }}
artifactory_password: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_PASSWORD }}
build_notebook_image:
name: Build Notebook Image
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: false
- name: Set version tags
run: |
echo "Ref name is ${{ github.ref_name }}"
echo "TAG_PREFIX is ${{ env.TAG_PREFIX }}"
REF_NAME=${{ github.ref_name }}
TAG_PREFIX=${{ env.TAG_PREFIX }}
VERSION_TAG=$(echo $REF_NAME | cut -d $TAG_PREFIX -f 2-)-jupyter
echo "Setting VERSION_TAG equal to $VERSION_TAG"
echo "VERSION_TAG=$VERSION_TAG" >> $GITHUB_ENV
- name: Build and Push jupyter image
uses: truefoundry/workflows/.github/workflows/[email protected]
with:
image_tag: ${{ env.VERSION_TAG }}
platforms: linux/amd64
image_artifact_name: ${{ github.event.repository.name }}
artifactory_registry_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_REGISTRY_URL }}
artifactory_repository_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_REPOSITORY }}
secrets:
artifactory_username: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_USERNAME }}
artifactory_password: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_PASSWORD }}