Skip to content

Version update

Version update #57

Workflow file for this run

name: Build and Push Model Images
on:
push:
tags:
- "release-*"
jobs:
prepare:
runs-on: ubicloud-standard-8
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
release_version: ${{ steps.get-release-version.outputs.release_version }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: |
MODELS=$(find src/endpoints -type f -name handler.py | xargs -n1 dirname | xargs -n1 basename | jq -R -s -c 'split("\n")[:-1]')
echo "matrix=${MODELS}" >> $GITHUB_OUTPUT
- id: get-release-version
run: |
RELEASE_VERSION=$(echo ${{ github.ref_name }} | sed 's/release-//')
echo "release_version=${RELEASE_VERSION}" >> $GITHUB_OUTPUT
build-and-push:
needs: prepare
runs-on: ubicloud-standard-8
strategy:
matrix:
model: ${{fromJson(needs.prepare.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt clean
docker rmi $(docker image ls -aq)
df -h
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: stb.sh/stablecog
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
build-args: |
MODEL_FOLDER=${{ matrix.model }}
tags: |
stb.sh/stablecog/sc-worker-rp-${{ matrix.model }}:${{ needs.prepare.outputs.release_version }}
stb.sh/stablecog/sc-worker-rp-${{ matrix.model }}:latest
secrets: |
"HF_TOKEN=${{ secrets.HF_TOKEN }}"