32 lines
1.0 KiB
YAML
32 lines
1.0 KiB
YAML
name: Build website container
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
name: Build image
|
|
runs-on: ubuntu-latest
|
|
container: ghcr.io/catthehacker/ubuntu:act-latest@sha256:78fc1ce62f01032916d08600dbe2913861f88b98f06d9273cdc1bc067f4a3df9
|
|
env:
|
|
IMAGE_NAME: mlflow
|
|
REGISTRY: git.namesny.com
|
|
REPO_OWNER: cluster
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Login to Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.namesny.com
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
- name: Build and push
|
|
run: |
|
|
VERSION=$(cat requirements.txt | grep mlflow | cut -d'=' -f3)
|
|
TODAY=$(date +'%Y-%m-%d')
|
|
docker build -t ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:${VERSION}-${TODAY} -t ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:latest .
|
|
docker push ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:${VERSION}-${TODAY}
|
|
docker push ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:latest
|
|
|