Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add workflow and documentation for OCI release #54

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/release-chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Publish chart as OCI image to GitHub registry. Version is automatically gathered from the tag name.
# For this workflow to work, GITHUB_TOKEN needs to be configured with write permissions.
# Additionally, the repository must be granted access in the package settings.

name: Publish chart

on:
release:
types: [ released ]

jobs:
release:
name: Publish chart to OCI registry
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Helm login
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | \
helm registry login ghcr.io \
--username "$GITHUB_REPOSITORY_OWNER" \
--password-stdin
- name: Helm package
run: |
helm package . -u --version "${GITHUB_REF_NAME#v}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chart versions should not have a leading v, so we strip it here.

- name: Helm push
run: |
helm push \
"mastodon-${GITHUB_REF_NAME#v}.tgz" \
"oci://ghcr.io/$GITHUB_REPOSITORY_OWNER/charts"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will result in a final URL of ghcr.io/mastodon/charts/mastodon, because helm push automatically appends the name of the chart after this URL. Tag is automatically set by helm push from the chart version.

8 changes: 4 additions & 4 deletions Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ description: Mastodon is a free, open-source social network server based on Acti
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

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

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ Kubernetes cluster. The basic usage is:

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

# Installation

This chart is [released as an OCI image](https://helm.sh/docs/topics/registries/) to `ghcr.io/mastodon/charts/mastodon`. You can install it without the need to add any repository to your helm installation using:

```shell
helm install mastodon oci://ghcr.io/mastodon/charts/mastodon --values your-values-file.yaml
```

You can also add it as a dependency to another chart in your Chart.yaml:

```yaml
dependencies:
- name: mastodon
version: 4.0.0
repository: oci://ghcr.io/mastodon/charts
```

# Configuration

The variables that _must_ be configured are:
Expand Down