-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.56 KB
/
chart-preview.yml
File metadata and controls
52 lines (42 loc) · 1.56 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
name: Chart Preview
on:
pull_request:
paths:
- 'chart/**'
- '.github/workflows/chart-preview.yml'
jobs:
preview:
permissions:
contents: read
packages: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Helm
uses: azure/setup-helm@v4
- name: Update chart dependencies
run: helm dependency update ./chart
- name: Set preview version
run: |
CURRENT_VERSION=$(grep '^version:' chart/Chart.yaml | awk '{print $2}')
PREVIEW_VERSION="${CURRENT_VERSION}-pr.${{ github.event.pull_request.number }}"
sed -i "s/^version: .*/version: ${PREVIEW_VERSION}/" chart/Chart.yaml
echo "PREVIEW_VERSION=${PREVIEW_VERSION}" >> $GITHUB_ENV
- name: Login to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Package and push
run: |
helm package ./chart
helm push theia-shared-cache-${PREVIEW_VERSION}.tgz oci://ghcr.io/${{ github.repository_owner }}/charts
- name: Comment install instructions
uses: marocchino/sticky-pull-request-comment@v2
with:
header: chart-preview
message: |
## 📦 Chart Preview Ready
```bash
helm install test oci://ghcr.io/${{ github.repository_owner }}/charts/theia-shared-cache --version ${{ env.PREVIEW_VERSION }}
```
_Updated: ${{ github.sha }}_