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