Skip to content

Commit 46ee227

Browse files
author
Frederic Spiers
committed
feat(ci): implement ci for for workflow
1 parent 93762d4 commit 46ee227

File tree

10 files changed

+178
-115
lines changed

10 files changed

+178
-115
lines changed

.github/workflows/pull-request.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,64 @@ jobs:
144144
else
145145
echo "No changed CHANGELOGS, skip push"
146146
fi
147+
148+
publish-chart:
149+
name: Publish Helm Chart
150+
needs: [lint-test]
151+
runs-on: ubuntu-latest
152+
steps:
153+
- uses: azure/setup-helm@v4.3.1
154+
155+
- name: Checkout pull request branch
156+
uses: actions/checkout@v5.0.0
157+
with:
158+
ref: ${{ github.head_ref }}
159+
repository: ${{github.event.pull_request.head.repo.full_name}}
160+
fetch-depth: 0
161+
162+
- name: Set up chart-testing-action
163+
uses: helm/chart-testing-action@v2.7.0
164+
165+
- name: Get changed charts
166+
id: list-changed
167+
run: |
168+
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
169+
if [[ -n "$changed" ]]; then
170+
echo "Changed charts:"
171+
echo "$changed"
172+
echo "changed=$changed" >> $GITHUB_OUTPUT
173+
else
174+
echo "No chart changes detected"
175+
fi
176+
177+
- name: Publish Helm chart to ttl
178+
id: upload
179+
if: ${{ steps.list-changed.outputs.changed }}
180+
run: |
181+
CHANGED_CHARTS="${{ steps.list-changed.outputs.changed }}"
182+
183+
RELEASED_CHARTS=""
184+
for chart_directory in ${CHANGED_CHARTS//,/ }; do
185+
CHART_NAME=${chart_directory#charts/}
186+
187+
cd $chart_directory
188+
189+
CHART_VERSION='0.1.0-${{ github.run_number }}'
190+
APP_VERSION='unstable-${GITHUB_SHA::7}'
191+
192+
helm dep update .
193+
helm lint --strict .
194+
helm package . --app-version=${APP_VERSION} --version=${CHART_VERSION}
195+
196+
# Push to GHCR
197+
echo "Pushing Helm chart $CHART_NAME-$CHART_VERSION.tgz to oci://ttl.sh/${{ github.event.repository.name }}/helm"
198+
if helm push ./$CHART_NAME-$CHART_VERSION.tgz oci://ttl.sh/${{ github.event.repository.name }}/helm; then
199+
echo "Successfully released $CHART_NAME-$CHART_VERSION to ttl.sh"
200+
else
201+
echo "Failed to push $CHART_NAME-$CHART_VERSION to ttl.sh"
202+
exit 1
203+
fi
204+
205+
cd ${{ github.workspace }}
206+
done
207+
echo "released_charts=$RELEASED_CHARTS" >> "$GITHUB_OUTPUT"

.github/workflows/release.yaml

Lines changed: 23 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: write
10+
packages: write
11+
attestations: write
12+
id-token: write
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
16+
cancel-in-progress: true
17+
818
jobs:
9-
release:
10-
permissions:
11-
contents: write
12-
packages: write
19+
publish-chart:
1320
runs-on: ubuntu-latest
1421
steps:
1522
- name: Checkout
16-
uses: actions/checkout@v5.0.0
23+
uses: actions/checkout@v5
1724
with:
1825
fetch-depth: 0
1926

@@ -22,19 +29,13 @@ jobs:
2229
git config user.name "$GITHUB_ACTOR"
2330
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
2431
25-
- name: Login to Registry
26-
uses: docker/login-action@v3
27-
with:
28-
registry: ${{ vars.REGISTRY }}
29-
username: ${{ secrets.REGISTRY_USER }}
30-
password: ${{ secrets.REGISTRY_PASSWORD }}
31-
32-
- name: Login to GHCR
33-
uses: docker/login-action@v3
34-
with:
35-
registry: ghcr.io
36-
username: ${{ github.actor }}
37-
password: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Login to GHCR Helm registry
33+
shell: bash
34+
run: |
35+
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login \
36+
ghcr.io \
37+
--username ${{ github.actor }} \
38+
--password-stdin
3839
3940
- name: Run chart-releaser
4041
id: chart-releaser
@@ -44,69 +45,28 @@ jobs:
4445
env:
4546
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
4647

47-
- name: Install cosign
48-
uses: sigstore/cosign-installer@v3.9.2
49-
if: ${{ steps.chart-releaser.outputs.changed_charts }}
50-
51-
- id: github-repo-owner-name
52-
uses: ASzc/change-string-case-action@v6
53-
with:
54-
string: ${{ github.repository_owner }}
55-
56-
- name: Upload charts to OCI registries
48+
- name: Upload charts to OCI GHCR
5749
id: upload
5850
if: ${{ steps.chart-releaser.outputs.changed_charts }}
59-
env:
60-
COSIGN_KEY: ${{ secrets.COSIGN_KEY }}
61-
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
62-
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
6351
run: |
6452
CHANGED_CHARTS="${{ steps.chart-releaser.outputs.changed_charts }}"
65-
66-
# Login to primary registry
67-
helm registry login --username $REGISTRY_USER --password ${{ secrets.REGISTRY_PASSWORD }} https://${{ vars.REGISTRY }}
68-
69-
# Login to GHCR
70-
helm registry login --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} https://ghcr.io
53+
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
7154
7255
RELEASED_CHARTS=""
7356
for chart_directory in ${CHANGED_CHARTS//,/ }; do
7457
CHART_NAME=${chart_directory#charts/}
7558
7659
cd $chart_directory
7760
78-
# Extract version and appVersion from Chart.yaml
7961
CHART_VERSION=$(yq eval '.version' "Chart.yaml")
8062
APP_VERSION=$(yq eval '.appVersion' "Chart.yaml")
8163
82-
# Push to primary registry (Docker Hub)
83-
echo "Pushing Helm chart $CHART_NAME-$CHART_VERSION.tgz to oci://${{ vars.REGISTRY }}/${{ vars.REPOSITORY }}"
84-
if helm push ${{ github.workspace }}/.cr-release-packages/${CHART_NAME}-${CHART_VERSION}.tgz oci://${{ vars.REGISTRY }}/${{ vars.REPOSITORY }} 2>&1 | tee ${CHART_NAME}-output.log; then
85-
86-
# Extract digest and sign chart
87-
DIGEST=$(cat ${CHART_NAME}-output.log | awk -F '[, ]+' '/Digest/{print $NF}')
88-
cosign sign -y --key env://COSIGN_KEY ${{ vars.REGISTRY }}/${{ vars.REPOSITORY }}/${CHART_NAME}:${CHART_VERSION}@$DIGEST
89-
90-
RELEASED_CHARTS="$RELEASED_CHARTS ${CHART_NAME}"
91-
echo "Successfully released $CHART_NAME-$CHART_VERSION to primary registry"
92-
else
93-
echo "Failed to push $CHART_NAME-$CHART_VERSION to primary registry"
94-
cat ${CHART_NAME}-output.log
95-
exit 1
96-
fi
97-
9864
# Push to GHCR
99-
echo "Pushing Helm chart $CHART_NAME-$CHART_VERSION.tgz to oci://ghcr.io/${{ steps.github-repo-owner-name.outputs.lowercase }}/helm-charts"
100-
if helm push ${{ github.workspace }}/.cr-release-packages/${CHART_NAME}-${CHART_VERSION}.tgz oci://ghcr.io/${{ steps.github-repo-owner-name.outputs.lowercase }}/helm-charts 2>&1 | tee ${CHART_NAME}-ghcr-output.log; then
101-
102-
# Extract digest and sign GHCR chart
103-
GHCR_DIGEST=$(cat ${CHART_NAME}-ghcr-output.log | awk -F '[, ]+' '/Digest/{print $NF}')
104-
cosign sign -y --key env://COSIGN_KEY ghcr.io/${{ steps.github-repo-owner-name.outputs.lowercase }}/helm-charts/${CHART_NAME}:${CHART_VERSION}@$GHCR_DIGEST
105-
65+
echo "Pushing Helm chart $CHART_NAME-$CHART_VERSION.tgz to oci://ghcr.io/${REPO_LOWER}"
66+
if helm push ${{ github.workspace }}/.cr-release-packages/${CHART_NAME}-${CHART_VERSION}.tgz oci://ghcr.io/${REPO_LOWER}; then
10667
echo "Successfully released $CHART_NAME-$CHART_VERSION to GHCR"
10768
else
10869
echo "Failed to push $CHART_NAME-$CHART_VERSION to GHCR"
109-
cat ${CHART_NAME}-ghcr-output.log
11070
exit 1
11171
fi
11272

charts/ghost/CHANGELOG.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Changelog
22

3-
## 0.1.0 (2025-09-24)
3+
## 0.2.1 (2025-10-01)
44

5-
* [postgres] fix: Change default name for CUSTOM_PASSWORD ([#144](https://github.com/CloudPirates-io/helm-charts/pull/144))
5+
* [ghost] switch helm-chart icon to a new svg ([#199](https://github.com/CloudPirates-io/helm-charts/pull/199))
6+
7+
## 0.2.0 (2025-10-01)
8+
9+
* make ghost run on openshift (#195) ([93762d4](https://github.com/CloudPirates-io/helm-charts/commit/93762d4)), closes [#195](https://github.com/CloudPirates-io/helm-charts/issues/195)
10+
* add artifacthub repo ID ([665bf26](https://github.com/CloudPirates-io/helm-charts/commit/665bf26))
11+
* add ghost ([83ef05d](https://github.com/CloudPirates-io/helm-charts/commit/83ef05d))
12+
* add ghost logo ([6a4df33](https://github.com/CloudPirates-io/helm-charts/commit/6a4df33))
13+
* add maintainer information ([7eec72b](https://github.com/CloudPirates-io/helm-charts/commit/7eec72b))
14+
* fix app version ([688338c](https://github.com/CloudPirates-io/helm-charts/commit/688338c))
15+
* fix Chart.lock for linting ([40c4159](https://github.com/CloudPirates-io/helm-charts/commit/40c4159))
16+
* fix configuration and installation ([40a2729](https://github.com/CloudPirates-io/helm-charts/commit/40a2729))
17+
* fix unittest typo ([cc31439](https://github.com/CloudPirates-io/helm-charts/commit/cc31439))
18+
* improve configuration settings for more clearity with 'externaldb' ([d539bf8](https://github.com/CloudPirates-io/helm-charts/commit/d539bf8))
19+
* improve startup, wait for mariadb to be ready ([8baec0a](https://github.com/CloudPirates-io/helm-charts/commit/8baec0a))
20+
* Update CHANGELOG.md ([dc9fbd8](https://github.com/CloudPirates-io/helm-charts/commit/dc9fbd8))
21+
* Update CHANGELOG.md ([1bee7fe](https://github.com/CloudPirates-io/helm-charts/commit/1bee7fe))
22+
* update docs ([333b4e3](https://github.com/CloudPirates-io/helm-charts/commit/333b4e3))
23+
* update docs ([d503408](https://github.com/CloudPirates-io/helm-charts/commit/d503408))
24+
* update docs for external database connection ([1fa8f61](https://github.com/CloudPirates-io/helm-charts/commit/1fa8f61))
25+
* update values schema with missing fields ([3f38991](https://github.com/CloudPirates-io/helm-charts/commit/3f38991))
26+
* chore: add Newline for the linter ([a667374](https://github.com/CloudPirates-io/helm-charts/commit/a667374))
27+
* chore: fix linting, remove trailing spaces ([0f2465d](https://github.com/CloudPirates-io/helm-charts/commit/0f2465d))

charts/ghost/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: ghost
33
description: A simple, powerful publishing platform that allows you to share your stories with the world.
44
type: application
5-
version: 0.2.0
5+
version: 0.2.2
66
appVersion: "6.0.9"
77
keywords:
88
- ghost
@@ -25,4 +25,4 @@ dependencies:
2525
version: "0.3.x"
2626
repository: oci://registry-1.docker.io/cloudpirates
2727
condition: mariadb.enabled
28-
icon: https://a.storyblok.com/f/143071/512x512/a130ba5305/ghost-logo.svg
28+
icon: https://a.storyblok.com/f/143071/512x512/3a5c1cb0c5/ghost-logo.png

0 commit comments

Comments
 (0)