-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (78 loc) · 2.71 KB
/
Copy pathrelease.yaml
File metadata and controls
90 lines (78 loc) · 2.71 KB
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
86
87
88
89
90
name: release
on:
push:
branches: ["main"]
# İstersen stable release için tag ekleyebilirsin:
# push:
# tags: ["v*"]
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
CHART_DIR: charts/llm-gateway
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set tags
run: |
echo "SHA_TAG=sha-${GITHUB_SHA::7}" >> $GITHUB_ENV
echo "DEV_VER=0.1.0-dev.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
echo "OWNER_LC=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Debug repo tree
run: |
pwd
ls -la
echo "---- find Dockerfiles ----"
find . -maxdepth 5 -type f -name "Dockerfile" -print
echo "---- find charts ----"
find . -maxdepth 5 -type d -name "charts" -print
echo "---- list top-level dirs ----"
find . -maxdepth 2 -type d -print
# ---- Build & push images ----
- name: Build & push llm-proxy
uses: docker/build-push-action@v6
with:
context: .
file: ./proxy/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.OWNER_LC }}/llm-proxy:${{ env.SHA_TAG }}
${{ env.REGISTRY }}/${{ env.OWNER_LC }}/llm-proxy:edge
- name: Build & push llm-collector
uses: docker/build-push-action@v6
with:
context: .
file: ./collector/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.OWNER_LC }}/llm-collector:${{ env.SHA_TAG }}
${{ env.REGISTRY }}/${{ env.OWNER_LC }}/llm-collector:edge
# ---- Package & push Helm chart to OCI ----
- name: Setup Helm
uses: azure/setup-helm@v4
- name: Bump Chart.yaml version/appVersion (main snapshots)
run: |
python - << 'PY'
import yaml
from pathlib import Path
chart = Path("${{ env.CHART_DIR }}") / "Chart.yaml"
data = yaml.safe_load(chart.read_text())
data["version"] = "${{ env.DEV_VER }}"
data["appVersion"] = "${{ env.SHA_TAG }}"
chart.write_text(yaml.safe_dump(data, sort_keys=False))
print("Updated", chart, "->", data["version"], data["appVersion"])
PY
shell: bash
- name: Helm package & push (OCI)
run: |
helm package $CHART_DIR -d /tmp/charts
helm push /tmp/charts/*.tgz oci://ghcr.io/${OWNER_LC}/charts