-
Notifications
You must be signed in to change notification settings - Fork 22
83 lines (68 loc) · 2.46 KB
/
Copy pathhelm_release.yaml
File metadata and controls
83 lines (68 loc) · 2.46 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
name: Release Charts
env:
HELM_VERSION: "3.14.0"
OCI_REGISTRY: ghcr.io/${{ github.repository_owner }}
HELM_REPO_URL: https://helm.questdb.io/
on:
push:
branches: [master]
paths: ['charts/questdb/Chart.yaml']
workflow_dispatch:
concurrency:
group: helm-release
cancel-in-progress: false
jobs:
release:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install yq
run: |
YQ_VERSION=v4.44.3
wget -q "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" -O /usr/local/bin/yq
chmod +x /usr/local/bin/yq
- name: Extract version
id: version
run: |
VERSION=$(yq '.version' charts/questdb/Chart.yaml)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Install Helm
uses: Azure/setup-helm@v4.2.0
with:
version: ${{ env.HELM_VERSION }}
- name: Package chart
run: helm package charts/questdb/ --destination ./packaged
- name: Push to OCI registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io --username "${{ github.repository_owner }}" --password-stdin
helm push ./packaged/questdb-${{ steps.version.outputs.version }}.tgz oci://${{ env.OCI_REGISTRY }}
- name: Update GitHub Pages helm repo
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
REPO_DIR=$(mktemp -d)
git fetch origin repo:repo
git worktree add "$REPO_DIR" repo
mkdir -p "$REPO_DIR/docs"
cp ./packaged/questdb-${{ steps.version.outputs.version }}.tgz "$REPO_DIR/docs/"
if [ -f "$REPO_DIR/docs/index.yaml" ]; then
helm repo index \
--url "${{ env.HELM_REPO_URL }}" \
--merge "$REPO_DIR/docs/index.yaml" \
./packaged
else
helm repo index \
--url "${{ env.HELM_REPO_URL }}" \
./packaged
fi
cp ./packaged/index.yaml "$REPO_DIR/docs/index.yaml"
cd "$REPO_DIR"
git add docs/index.yaml "docs/questdb-${{ steps.version.outputs.version }}.tgz"
git commit -m "Release chart questdb-${{ steps.version.outputs.version }}"
git push origin repo