-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (78 loc) · 2.77 KB
/
1-runner.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
name: CI Runner
on:
push:
branches:
- main
paths:
- docker/*
workflow_dispatch:
# yamllint disable rule:colons
env: # define 'static' vars here
platforms: "linux/amd64,linux/arm64"
gh_registry: ghcr.io/ninerealmlabs
# d_registry: docker.io/ninerealmlabs
owner: ninerealmlabs
# yamllint enable
jobs:
# "Any environment variables set in an env context defined at the workflow level in the caller workflow
# are NOT propagated to the called workflow"
export-envs:
# runs-on: self-hosted
runs-on: ubuntu-latest
outputs:
# yamllint disable rule:colons
platforms: ${{ env.platforms }}
gh_registry: ${{ env.gh_registry }}
# d_registry: ${{ env.d_registry }}
owner: ${{ env.owner }}
version: ${{ steps.version.outputs.version }}
# yamllint enable
steps:
- run: echo "Exposing env vars to downstream jobs 📬"
- name: Checkout Repo 🛒
uses: actions/checkout@v4
- name: Get MLFlow version 🏷
id: version
shell: bash
run: |
# extract mlflow version from requirements.txt
VERSION="$(grep 'mlflow' docker/requirements.txt | xargs | sed s'|^.*==||g' | sed s'|[[:space:]]||g')"
# ------------------------------------------------------------------
echo "VERSION: ${VERSION}"
# ------------------------------------------------------------------
echo "version=${VERSION}" >> $GITHUB_OUTPUT
build:
needs: [export-envs]
uses: ./.github/workflows/2-build-test-tag.yaml
with:
# yamllint disable rule:colons
source_image: python # <-- UPDATE ###
source_tag: 3.10-slim-bullseye # <-- UPDATE ###
# source_digest: '' # <-- UPDATE ###
image_name: mlflow-server
platforms: ${{ needs.export-envs.outputs.platforms }}
gh_registry: ${{ needs.export-envs.outputs.gh_registry }}
# d_registry: ${{ inputs.d_registry }}
owner: ${{ needs.export-envs.outputs.owner }}
version: ${{ needs.export-envs.outputs.version }}
# yamllint enable
secrets: inherit
release:
needs: [export-envs, build]
if: ${{ needs.build.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Create tag
uses: actions/github-script@v7
with:
script: |
const { VERSION } = process.env
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${VERSION}`,
sha: context.sha
})
env:
VERSION: ${{ needs.export-envs.outputs.version }}