diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index 2a828ca..d4eb807 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -1,8 +1,6 @@ name: Build website container on: - push: - branches: - - main + push: tags jobs: build: diff --git a/.gitea/workflows/tag.yaml b/.gitea/workflows/tag.yaml new file mode 100644 index 0000000..b91b954 --- /dev/null +++ b/.gitea/workflows/tag.yaml @@ -0,0 +1,28 @@ +name: Create mlflow tag +on: + push: + branches: + - main + +jobs: + build: + name: Build image + runs-on: ubuntu-latest + container: ghcr.io/catthehacker/ubuntu:act-latest@sha256:8583ed2b7d097609ff91cc914696324ee945ceb8639967759f4cebbfcb8e63a5 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Get latest git tag + id: tag + run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT + - name: Get mlflow version + id: mlflow + run: echo "mlflow=$(cat requirements.txt | grep mlflow | cut -d'=' -f3)" >> $GITHUB_OUTPUT + - name: Create tag if it doesn't exist + run: | + if [[ $(git tag -l "${{ steps.tag.outputs.tag }}") ]]; then + echo "Tag already exists" + else + git tag ${{ steps.mlflow.outputs.mlflow }} + git push origin ${{ steps.mlflow.outputs.mlflow }} + fi