-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (114 loc) · 3.38 KB
/
release.yaml
File metadata and controls
128 lines (114 loc) · 3.38 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Release Charts
on:
push:
branches:
- main
paths:
- 'charts/**'
- '.github/workflows/**'
- 'ct.yaml'
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.13.0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up chart-testing
uses: helm/chart-testing-action@v2
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml --charts charts/logtide
# NOTE: Test job disabled until Docker images are published to ghcr.io
# test:
# runs-on: ubuntu-latest
# needs: lint
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Set up Helm
# uses: azure/setup-helm@v3
# with:
# version: v3.13.0
#
# - name: Create kind cluster
# uses: helm/kind-action@v1
#
# - name: Install chart
# run: |
# helm install logtide ./charts/logtide \
# --namespace logtide \
# --create-namespace \
# --set timescaledb.auth.password=testpassword \
# --set timescaledb.auth.postgresPassword=testpassword \
# --set redis.auth.password=testpassword \
# --wait \
# --timeout 5m
#
# - name: Verify installation
# run: |
# kubectl get pods -n logtide
# kubectl get svc -n logtide
release:
runs-on: ubuntu-latest
needs: lint
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Create gh-pages branch if not exists
run: |
if ! git ls-remote --heads origin gh-pages | grep -q gh-pages; then
echo "Creating gh-pages branch..."
git checkout --orphan gh-pages
git rm -rf .
echo "# LogTide Helm Charts" > README.md
git add README.md
git commit -m "Initial gh-pages branch"
git push origin gh-pages
git checkout main
fi
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.13.0
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.6.0
with:
charts_dir: charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Add artifacthub-repo.yml to gh-pages
run: |
git fetch origin gh-pages
git checkout gh-pages
git pull origin gh-pages --rebase
curl -sL https://raw.githubusercontent.com/${{ github.repository }}/main/artifacthub-repo.yml -o artifacthub-repo.yml
if [ -f artifacthub-repo.yml ]; then
git add artifacthub-repo.yml
git diff --staged --quiet || git commit -m "Add artifacthub-repo.yml for verified publisher"
git push origin gh-pages
fi
git checkout main