configure CI to push Helm charts
This commit is contained in:
parent
10c01f6ede
commit
f8050ca69e
@ -19,6 +19,12 @@ jobs:
|
|||||||
checks: write
|
checks: write
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
|
- name: Login to Docker
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
@ -57,12 +63,26 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
DOCKER_ORG: ryanc
|
DOCKER_ORG: ryanc
|
||||||
DOCKER_LATEST: latest
|
DOCKER_LATEST: latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # all history for all branches and tags
|
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
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
@ -94,3 +114,14 @@ jobs:
|
|||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
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