Skip to content

Commit c2db75a

Browse files
committed
add workflow and documentation for OCI release
1 parent 4b6fd9f commit c2db75a

4 files changed

Lines changed: 53 additions & 6 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Publish chart as OCI image to GitHub registry. Version is automatically gathered from the tag name.
2+
# For this workflow to work, GITHUB_TOKEN needs to be configured with write permissions.
3+
# Additionally, the repository must be granted access in the package settings.
4+
5+
name: Publish chart
6+
7+
on:
8+
release:
9+
types: [ released ]
10+
11+
jobs:
12+
release:
13+
name: Publish chart to OCI registry
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Helm login
18+
run: |
19+
echo "${{ secrets.GITHUB_TOKEN }}" | \
20+
helm registry login ghcr.io \
21+
--username "$GITHUB_REPOSITORY_OWNER" \
22+
--password-stdin
23+
- name: Helm package
24+
run: |
25+
helm package . -u --version "${GITHUB_REF_NAME#v}"
26+
- name: Helm push
27+
run: |
28+
helm push \
29+
"mastodon-${GITHUB_REF_NAME#v}.tgz" \
30+
"oci://ghcr.io/$GITHUB_REPOSITORY_OWNER/charts"

Chart.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ dependencies:
88
- name: redis
99
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
1010
version: 16.13.2
11-
digest: sha256:17ea58a3264aa22faff18215c4269f47dabae956d0df273c684972f356416193
12-
generated: "2022-08-08T21:44:18.0195364+02:00"
11+
digest: sha256:8be2c8069d65f295d0079bdda67c45691370f7bef73393c2e80eedbdd748b9af
12+
generated: "2023-03-16T11:10:48.909118173+01:00"

Chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ description: Mastodon is a free, open-source social network server based on Acti
1212
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
1313
type: application
1414

15-
# This is the chart version. This version number should be incremented each time you make changes
16-
# to the chart and its templates, including the app version.
17-
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 4.0.0
15+
# Chart version is set to 0.0.0 in the source tree. The release pipeline replaces this with the version
16+
# being released in build time.
17+
# Please refer to git tags and/or GitHub releases to check out the latest version.
18+
version: 0.0.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ Kubernetes cluster. The basic usage is:
99

1010
This chart is tested with k8s 1.21+ and helm 3.6.0+.
1111

12+
# Installation
13+
14+
This chart is [released as an OCI image](https://helm.sh/docs/topics/registries/) to `ghcr.io/mastodon/chart`. You can install it without the need to add any repository to your helm installation using:
15+
16+
```shell
17+
helm install mastodon oci://ghcr.io/mastodon/charts/mastodon --values your-values-file.yaml
18+
```
19+
20+
You can also add it as a dependency to another chart in your Chart.yaml:
21+
22+
```yaml
23+
dependencies:
24+
- name: mastodon
25+
version: 4.0.0
26+
repository: oci://ghcr.io/mastodon/charts
27+
```
28+
1229
# Configuration
1330
1431
The variables that _must_ be configured are:

0 commit comments

Comments
 (0)