You've already forked ci-templates
generated from public/repo-template
init
This commit is contained in:
53
.gitea/workflows/helm_chart_publish.yaml
Normal file
53
.gitea/workflows/helm_chart_publish.yaml
Normal file
@@ -0,0 +1,53 @@
|
||||
name: Publish helm chart
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
ci_image:
|
||||
required: true
|
||||
type: string
|
||||
description: image to use inside the workflow jobs
|
||||
default: git.romalex.cc/public/ci-image:v1
|
||||
registry_user:
|
||||
required: true
|
||||
type: string
|
||||
description: username to access gitea registry
|
||||
default: ${{ github.actor }}
|
||||
secrets:
|
||||
registry_access_token:
|
||||
required: true
|
||||
description: Token to access the gitea registry
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint Helm chart
|
||||
runs-on: romalex-public
|
||||
container:
|
||||
image: ${{ inputs.ci_image }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Lint
|
||||
run: helm lint .
|
||||
package:
|
||||
name: Package and publish helm chart
|
||||
runs-on: romalex-public
|
||||
container:
|
||||
image: ${{ inputs.ci_image }}
|
||||
needs: lint
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Cleanup
|
||||
run: |
|
||||
rm -rf .git
|
||||
rm -rf .gitea
|
||||
- name: Package
|
||||
run: helm package .
|
||||
- name: Publish
|
||||
run: |
|
||||
CHART_NAME=$(yq .name < Chart.yaml)
|
||||
CHART_VERSION=$(yq .version < Chart.yaml)
|
||||
curl -u ${{ inputs.registry_user }}:${{ secrets.registry_access_token }} \
|
||||
-X POST \
|
||||
--upload-file "${CHART_NAME}-${CHART_VERSION}.tgz" \
|
||||
${{ github.server_url }}/api/packages/${{ github.repository_owner }}/helm/api/charts
|
||||
Reference in New Issue
Block a user