mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
ci: OCI release workflow changes
This commit is contained in:
parent
93e761fd99
commit
0cf022c6ac
3 changed files with 17 additions and 27 deletions
|
@ -65,8 +65,7 @@ jobs:
|
||||||
mapfile -t CHART_PATH_PARTS < <(echo "$CHART" | tr '/' '\n')
|
mapfile -t CHART_PATH_PARTS < <(echo "$CHART" | tr '/' '\n')
|
||||||
CHART_TYPE=${CHART_PATH_PARTS[0]}
|
CHART_TYPE=${CHART_PATH_PARTS[0]}
|
||||||
|
|
||||||
helm dep up "${SRC_DIR}/${CHART}"
|
helm package "${SRC_DIR}/${CHART}" --dependency-update --destination "${DEST_DIR}/${CHART_TYPE}"
|
||||||
helm package "${SRC_DIR}/${CHART}" -u -d "${DEST_DIR}/${CHART_TYPE}"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Update chart index
|
- name: Update chart index
|
||||||
|
|
39
.github/workflows/charts-release-oci.yaml
vendored
39
.github/workflows/charts-release-oci.yaml
vendored
|
@ -18,53 +18,44 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
HELM_VERSION: 3.11.1
|
HELM_VERSION: 3.11.1
|
||||||
|
CHARTS_SRC_DIR: "charts"
|
||||||
|
TARGET_REGISTRY: ghcr.io
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release-charts:
|
release-charts:
|
||||||
name: Release charts
|
name: Release charts
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Get GitHub API token
|
- name: Checkout chart sources
|
||||||
id: get-app-token
|
|
||||||
uses: getsentry/action-github-app-token@v1
|
|
||||||
with:
|
|
||||||
app_id: ${{ secrets.BJWS_APP_ID }}
|
|
||||||
private_key: ${{ secrets.BJWS_APP_PRIVATE_KEY }}
|
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
id: login-to-ghcr
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.BJWS_APP_PRIVATE_KEY }}
|
|
||||||
|
|
||||||
- name: Checkout charts branch
|
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.get-app-token.outputs.token }}
|
|
||||||
path: "src"
|
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Kubernetes tools
|
- name: Install Kubernetes tools
|
||||||
uses: yokawasa/action-setup-kube-tools@v0.8.2
|
uses: yokawasa/action-setup-kube-tools@v0.9.2
|
||||||
with:
|
with:
|
||||||
setup-tools: |
|
setup-tools: |
|
||||||
helmv3
|
helmv3
|
||||||
helm: "${{ env.HELM_VERSION }}"
|
helm: "${{ env.HELM_VERSION }}"
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ${{ env.TARGET_REGISTRY }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Package & Push Helm Charts
|
- name: Package & Push Helm Charts
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
|
||||||
SRC_DIR: "src/charts"
|
|
||||||
run: |
|
run: |
|
||||||
CHARTS=( $(yq --null-input e '${{ inputs.charts }}[]' ) )
|
CHARTS=( $(yq --null-input e '${{ inputs.charts }}[]' ) )
|
||||||
|
|
||||||
for CHART in "${CHARTS[@]}" ; do
|
for CHART in "${CHARTS[@]}" ; do
|
||||||
mapfile -t CHART_PATH_PARTS < <(echo "$CHART" | tr '/' '\n')
|
mapfile -t CHART_PATH_PARTS < <(echo "$CHART" | tr '/' '\n')
|
||||||
CHART_TYPE=${CHART_PATH_PARTS[0]}
|
CHART_TYPE=${CHART_PATH_PARTS[0]}
|
||||||
|
CHART_NAME=${CHART_PATH_PARTS[1]}
|
||||||
|
CHART_VERSION=$(yq e '.version' ${{ env.CHARTS_SRC_DIR }}/${CHART}/Chart.yaml)
|
||||||
|
|
||||||
helm dep up "${SRC_DIR}/${CHART}"
|
helm package "${{ env.CHARTS_SRC_DIR }}/${CHART_TYPE}/${CHART_NAME}" --dependency-update --destination "${{ env.CHARTS_SRC_DIR }}/${CHART_TYPE}"
|
||||||
helm package "${SRC_DIR}/${CHART}" -u
|
helm push "${{ env.CHARTS_SRC_DIR }}/${CHART_TYPE}/${CHART_NAME}-${CHART_VERSION}.tgz" oci://${{ env.TARGET_REGISTRY }}/${{ github.actor }}
|
||||||
helm push ${CHART} oci://ghcr.io/${{ github.actor }}
|
|
||||||
done
|
done
|
||||||
|
|
2
.github/workflows/charts-release.yaml
vendored
2
.github/workflows/charts-release.yaml
vendored
|
@ -61,7 +61,7 @@ jobs:
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
release-github-oci:
|
release-github-oci:
|
||||||
name: Release Application charts to GitHub pages
|
name: Release Application charts to GitHub Container Registry
|
||||||
uses: ./.github/workflows/charts-release-oci.yaml
|
uses: ./.github/workflows/charts-release-oci.yaml
|
||||||
needs:
|
needs:
|
||||||
- prepare
|
- prepare
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue