-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
114e511
commit c03800f
Showing
3 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Docker publish | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
on: | ||
push: | ||
# Publish semver tags as releases. | ||
tags: [ 'v*.*.*' ] | ||
|
||
env: | ||
# Use docker.io for Docker Hub if empty | ||
REGISTRY: ghcr.io | ||
# github.repository as <account>/<repo> | ||
CHARTS_REGISTRY: ${{ github.repository_owner }}/charts | ||
CHART_NAME: etcd-operator | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: read | ||
packages: write | ||
# This is used to complete the identity challenge | ||
# with sigstore/fulcio when running outside of PRs. | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4.1.1 | ||
|
||
- name: Install Helm | ||
uses: azure/setup-helm@v4.1.0 | ||
with: | ||
version: 'v3.14.3' | ||
|
||
- name: Get latest tag | ||
run: | | ||
git fetch --tags | ||
TAG=$(git describe --tags `git rev-list --tags --max-count=1`) | ||
echo "Latest tag on current commit is $TAG" | ||
echo "LATEST_TAG=${TAG}" >> $GITHUB_ENV | ||
echo "LATEST_TAG_TRIMMED_V=${TAG#v}" >> $GITHUB_ENV | ||
- name: Helm login registry | ||
working-directory: charts | ||
run: | | ||
helm registry login \ | ||
--username ${{ github.actor }} \ | ||
--password ${{ secrets.GITHUB_TOKEN }} \ | ||
${{ env.CHARTS_REGISTRY }} | ||
- name: Helm package chart | ||
working-directory: charts | ||
run: | | ||
helm package ${{ env.CHART_NAME }} \ | ||
--version ${LATEST_TAG_TRIMMED_V} \ | ||
--app-version ${LATEST_TAG} \ | ||
--dependency-update | ||
- name: Helm push chart | ||
working-directory: charts | ||
run: | | ||
helm push ${{ env.CHART_NAME }}-${LATEST_TAG_TRIMMED_V}.tgz \ | ||
oci://${{ env.CHARTS_REGISTRY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ apiVersion: v2 | |
name: etcd-operator | ||
type: application | ||
version: 0.0.1 | ||
appVersion: "0.0.1" | ||
appVersion: "v0.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters