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

Publish Kubernetes Tentacle chart to Artifactory #15

Merged
merged 24 commits into from
Dec 12, 2023
Merged
Changes from 15 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
62 changes: 62 additions & 0 deletions .github/workflows/kubernetes-tentacle-publish-chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Publish Kubernetes Tentacle to Artifactory

on:
push:
branches:
- main
paths:
- charts/kubernetes-target/**

pull_request:
branches:
- '*'
paths:
- charts/kubernetes-target/**

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Helm
uses: azure/setup-helm@v3
with:
version: 'v3.13.2'

- name: Parse Chart config
uses: pietrobolcato/[email protected]
id: read_chart_yaml
with:
config: ${{ github.workspace }}/charts/kubernetes-tentacle/Chart.yaml

- name: Get branch names
id: branch_names
uses: OctopusDeploy/util-actions/[email protected]

- id: version
shell: bash
run: |
pre_release=""

if [ steps.branch_names.outputs.branch_name -ne "main ]; then
pre_release="-${{ steps.branch_names.outputs.branch_name }}-$(date +'%Y%m%d%H%M%S')"
fi

echo "CHART_VERSION=${{ steps.read_chart_yaml.outputs.version }}$pre_release" >> $GITHUB_ENV

- name: Login to Artifactory
run: helm registry login ${{ secrets.ARTIFACTORY_DOCKER_REPO_HOSTNAME }} -u '${{ secrets.ARTIFACTORY_USERNAME }}' -p '${{ secrets.ARTIFACTORY_PASSWORD }}'

- name: Package Chart
run: helm package './charts/kubernetes-tentacle' --version '${{ env.CHART_VERSION }}'

- uses: actions/upload-artifact@v3
name: Upload packaged chart
with:
name: 'kubernetes-tentacle-${{ env.CHART_VERSION }}.tgz'
path: '${{ github.workspace }}/kubernetes-tentacle-${{ env.CHART_VERSION }}.tgz'

- name: Push Chart to Artifactory
run: helm push 'kubernetes-tentacle-${{ env.CHART_VERSION }}.tgz' oci://${{ secrets.ARTIFACTORY_DOCKER_REPO_HOSTNAME }}