configure CI to push Helm charts
This commit is contained in:
parent
10c01f6ede
commit
f8050ca69e
@ -19,6 +19,12 @@ jobs:
|
||||
checks: write
|
||||
contents: write
|
||||
steps:
|
||||
- name: Login to Docker
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@ -57,12 +63,26 @@ jobs:
|
||||
env:
|
||||
DOCKER_ORG: ryanc
|
||||
DOCKER_LATEST: latest
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # all history for all branches and tags
|
||||
|
||||
- name: Prepare
|
||||
id: prep
|
||||
run: |
|
||||
VERSION="sha-${GITHUB_SHA::8}"
|
||||
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
|
||||
VERSION="${GITHUB_REF/refs\/tags\//}"
|
||||
fi
|
||||
printf "GITHUB_REF=%s\n" "$GITHUB_REF"
|
||||
printf "GITHUB_SHA=%s\n" "$GITHUB_SHA"
|
||||
printf "VERSION=%s\n" "$VERSION" | tee -a "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
@ -94,3 +114,14 @@ jobs:
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
- name: Setup Helm
|
||||
uses: azure/setup-helm@v4.3.0
|
||||
|
||||
- name: Publish Helm chart
|
||||
if: ${{ contains(github.ref, 'refs/tags/') }}
|
||||
run: |
|
||||
HELM_VERSION="${{ steps.prep.outputs.VERSION }}"
|
||||
HELM_VERSION="${HELM_VERSION#v}"
|
||||
helm package charts/kubernaut
|
||||
helm push "kubernaut-${HELM_VERSION}.tgz" oci://git.kill0.net/ryanc/helm-charts
|
||||
|
Loading…
x
Reference in New Issue
Block a user