Update .github/workflows/update-helm-depends.yaml

This commit is contained in:
richardrobertreitz 2025-03-27 17:55:10 +00:00
parent ce6bfa6a9d
commit 2fcc8cc174

View file

@ -1,74 +1,74 @@
name: ci name: Update Helm Dependencies
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
logLevel: helmRepo:
description: 'Log Level' description: 'Helm Repository'
required: true required: true
default: 'warning' default: 'forgejo'
type: choice type: choice
options: options:
- info - argocd
- warning - forgejo
- debug - nginx
boolean: tag:
description: 'Boolean' description: 'Tag (e.g. v11.0.5)'
required: false
type: boolean
number:
description: 'Number'
default: '100'
type: number
string:
description: 'String'
required: true required: true
type: string type: string
jobs: jobs:
build: test:
runs-on: ubuntu-22.04 runs-on: docker
steps: steps:
-
name: Repository meta - name: Checkout helm repo
id: repository uses: actions/checkout@v4
with:
repository: giteaAdmin/${{ inputs.helmRepo }}-helm
token: ${{ secrets.PAT }}
ref: main
path: helmworkspace
- name: Update repo
run: | run: |
registry=${{ github.server_url }} cd helmworkspace
registry=${registry##http*://} echo repo: ${{ inputs.helmRepo }}
echo "registry=${registry}" >> "$GITHUB_OUTPUT" echo tag: ${{ inputs.tag }}
echo "registry=${registry}"
repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" git config user.name "github-actions[bot]"
echo "repository=${repository}" >> "$GITHUB_OUTPUT" git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
echo "repository=${repository}"
- git remote add upstream https://code.forgejo.org/forgejo-helm/forgejo-helm.git
name: Docker meta git fetch --all
uses: docker/metadata-action@v5 git checkout upstream/main
id: docker git checkout main
with: git merge upstream/main || true
images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }} git commit || true
-
name: Login to registry git push origin ${{ inputs.tag }}
uses: docker/login-action@v3
with: git checkout ${{ inputs.tag }}
registry: ${{ steps.repository.outputs.registry }} rm .gitignore
username: ${{ secrets.PACKAGES_USER }}
password: ${{ secrets.PACKAGES_TOKEN }} if [[ "$(uname -m)" == "x86_64" ]]; then
- wget https://get.helm.sh/helm-v3.16.2-linux-amd64.tar.gz
name: Set up QEMU tar xf helm-v3.16.2-linux-amd64.tar.gz
uses: docker/setup-qemu-action@v3 mv linux-amd64/helm ../helm
- rm -Rf linux-amd64 helm-v3.16.2-linux-amd64.tar.gz
name: Set up Docker Buildx else
uses: docker/setup-buildx-action@v3 wget https://get.helm.sh/helm-v3.16.2-linux-arm64.tar.gz
with: tar xf helm-v3.16.2-linux-arm64.tar.gz
buildkitd-flags: '--allow-insecure-entitlement network.host' mv linux-arm64/helm ../helm
driver-opts: network=host rm -Rf linux-arm64 helm-v3.16.2-linux-arm64.tar.gz
- fi
name: Build and push ../helm dependency update .
uses: docker/build-push-action@v6 ../helm dependency build .
with: git status
push: true git add -A
allow: network.host git commit -m "Added helm dependencies"
network: host git tag ${{ inputs.tag }}-depends
platforms: linux/amd64,linux/arm64 git push origin ${{ inputs.tag }}-depends
tags: ${{ steps.docker.outputs.tags }}