ci: use push-charts nodejs tool to manage push to GHCR.io (#23)

This commit is contained in:
Sebastian Poxhofer 2025-02-28 23:56:34 +01:00 committed by GitHub
parent 8994c62db5
commit 394ce954f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 1220 additions and 56 deletions

36
.github/workflows/ci.yaml vendored Normal file
View file

@ -0,0 +1,36 @@
name: CI
on:
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# renovate: datasource=node-version depName=node
NODE_VERSION: 22.14.0
jobs:
test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install dev dependencies
run: pnpm install --frozen-lockfile
- run: pnpm run prettier:check
- run: pnpm run test

View file

@ -5,31 +5,36 @@ on:
branches:
- main
env:
# renovate: datasource=node-version depName=node
NODE_VERSION: 22.14.0
permissions: {}
jobs:
release:
permissions:
contents: write # to push chart release and create a release (helm/chart-releaser-action)
packages: write # needed for ghcr access
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Set up Helm
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
with:
# renovate: datasource=github-releases depName=helm/helm
version: v3.17.1
- name: Run chart-releaser
id: releaser
uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0
@ -39,17 +44,18 @@ jobs:
skip_existing: true
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Login to GHCR
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Push charts to GHCR
run: |
IFS=',' read -ra CHARTS <<< "${{ steps.releaser.outputs.changed_charts }}"
for chart in "${CHARTS[@]}"; do
helm push "${chart}" "oci://ghcr.io/${GITHUB_REPOSITORY}"
done
run: "node --experimental-strip-types scripts/push-charts.ts ${{ steps.releaser.outputs.changed_charts }}"