forked from rh-ai-quickstart/RAG
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (83 loc) · 2.72 KB
/
release.yml
File metadata and controls
96 lines (83 loc) · 2.72 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
91
92
93
94
95
96
name: Release
on:
pull_request:
types: [closed]
branches:
- main
jobs:
cleanup-branch:
if: startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Delete release branch
run: |
git push origin --delete ${{ github.event.pull_request.head.ref }}
release:
if: |
github.event.pull_request.merged == true &&
startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
strategy:
matrix:
include:
- name: llamastack-dist-ui
context: frontend
chart: deploy/helm/rag/Chart.yaml
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version from Chart.yaml
id: version
run: |
version=$(grep '^version:' ${{ matrix.chart }} | awk '{print $2}')
echo "value=$version" >> $GITHUB_OUTPUT
- name: Create git tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "v${{ steps.version.outputs.value }}" -m "Release v${{ steps.version.outputs.value }}"
git push origin "v${{ steps.version.outputs.value }}"
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: 'latest'
- name: Update Helm dependencies
run: |
helm dependency update deploy/helm/rag
- name: Package Helm chart
run: |
helm package deploy/helm/rag -d .
ls -la rag-*.tgz
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "v${{ steps.version.outputs.value }}" \
--title "Release v${{ steps.version.outputs.value }}" \
--notes "Release v${{ steps.version.outputs.value }}" \
--latest \
rag-${{ steps.version.outputs.value }}.tgz
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ matrix.context }}
file: ${{ matrix.context }}/Containerfile
push: true
tags: quay.io/rh-ai-quickstart/${{ matrix.name }}:${{ steps.version.outputs.value }}