Publish Helm charts to OCI registry #4
This file contains hidden or 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
| --- | |
| name: Publish Helm charts to OCI registry | |
| on: | |
| push: | |
| branches: [master] | |
| paths: | |
| - "drupal/**" | |
| - "frontend/**" | |
| - "simple/**" | |
| - "elasticsearch/**" | |
| - "silta-release/**" | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: registry.wdr.io | |
| REGISTRY_PATH: registry.wdr.io/charts | |
| jobs: | |
| publish: | |
| name: Package & Push — ${{ matrix.chart }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| chart: [drupal, frontend, simple] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4 | |
| - name: Add dependency repos | |
| run: | | |
| helm repo add wunderio https://storage.googleapis.com/charts.wdr.io | |
| helm repo add jouve https://jouve.github.io/charts/ | |
| helm repo add percona https://percona.github.io/percona-helm-charts/ | |
| helm repo update | |
| - name: Build chart dependencies | |
| run: helm dependency build ./${{ matrix.chart }} | |
| - name: Lint chart | |
| run: helm lint ./${{ matrix.chart }} | |
| - name: Package chart | |
| id: package | |
| run: | | |
| helm package ./${{ matrix.chart }} --destination /tmp/charts | |
| PKG=$(ls /tmp/charts/${{ matrix.chart }}-*.tgz) | |
| echo "package=${PKG}" >> "$GITHUB_OUTPUT" | |
| - name: Log in to Harbor | |
| run: | | |
| echo "${{ secrets.REGISTRY_PASSWORD }}" | \ | |
| helm registry login "${{ env.REGISTRY }}" \ | |
| --username "${{ secrets.REGISTRY_USERNAME }}" \ | |
| --password-stdin | |
| - name: Push chart to Harbor | |
| run: | | |
| helm push "${{ steps.package.outputs.package }}" \ | |
| "oci://${{ env.REGISTRY_PATH }}" |