Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84ed9e478e | ||
|
|
c8a745f997 | ||
| ce6fcab5f3 |
@@ -5,6 +5,10 @@ on:
|
||||
- cron: '0 2 * * 1'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
REGISTRY_URL: https://git.cafepieters.com
|
||||
OWNER: helmchart
|
||||
|
||||
jobs:
|
||||
update-and-release:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -222,7 +226,9 @@ jobs:
|
||||
if: steps.check_update.outputs.php_updated == 'true'
|
||||
run: |
|
||||
helm package .
|
||||
echo "Helm chart packaged"
|
||||
CHART_FILE=$(ls *.tgz)
|
||||
echo "CHART_FILE=${CHART_FILE}" >> $GITHUB_ENV
|
||||
echo "Helm chart packaged: ${CHART_FILE}"
|
||||
|
||||
- name: Create Git Tag
|
||||
if: steps.check_update.outputs.php_updated == 'true'
|
||||
@@ -258,54 +264,18 @@ jobs:
|
||||
echo "Release created"
|
||||
fi
|
||||
|
||||
- name: Update Helm Repository Index
|
||||
- name: Publish to Gitea Package Registry
|
||||
if: steps.check_update.outputs.php_updated == 'true'
|
||||
run: |
|
||||
set -e
|
||||
APP_VERSION="${{ steps.php.outputs.app_version }}"
|
||||
CHART_NAME=$(grep '^name:' Chart.yaml | awk '{print $2}')
|
||||
PACKAGE_FILE="${CHART_NAME}-${APP_VERSION}.tgz"
|
||||
|
||||
echo "Preparing Helm repository update..."
|
||||
|
||||
# パッケージファイルを一時ディレクトリに移動
|
||||
mkdir -p /tmp/helm-repo
|
||||
cp "${PACKAGE_FILE}" /tmp/helm-repo/
|
||||
|
||||
# gh-pagesブランチの処理
|
||||
if git ls-remote --heads origin gh-pages | grep gh-pages; then
|
||||
echo "gh-pages branch exists, checking out..."
|
||||
git fetch origin gh-pages
|
||||
git checkout gh-pages
|
||||
else
|
||||
echo "Creating new gh-pages branch..."
|
||||
git checkout --orphan gh-pages
|
||||
git rm -rf . || true
|
||||
echo "# Helm Repository" > README.md
|
||||
git add README.md
|
||||
git config user.name "GitHub Actions Bot"
|
||||
git config user.email "actions@github.com"
|
||||
git commit -m "Initialize gh-pages branch"
|
||||
git push origin gh-pages
|
||||
fi
|
||||
|
||||
# パッケージファイルをコピー
|
||||
cp /tmp/helm-repo/"${PACKAGE_FILE}" .
|
||||
|
||||
# index.yamlを生成/更新
|
||||
helm repo index . --url "https://git.cafepieters.com/${GITHUB_REPOSITORY}/raw/branch/gh-pages"
|
||||
|
||||
# コミットしてプッシュ
|
||||
git config user.name "GitHub Actions Bot"
|
||||
git config user.email "actions@github.com"
|
||||
git add "${PACKAGE_FILE}" index.yaml
|
||||
git commit -m "chore: add ${CHART_NAME} v${APP_VERSION}" || echo "No changes to commit"
|
||||
git push origin gh-pages
|
||||
|
||||
echo "Helm repository updated successfully"
|
||||
|
||||
# mainブランチに戻る
|
||||
git checkout main
|
||||
echo "🚀 Publishing ${CHART_FILE} to Gitea Package Registry..."
|
||||
|
||||
curl --fail-with-body \
|
||||
-u "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_TOKEN }}" \
|
||||
-X POST \
|
||||
--upload-file "${CHART_FILE}" \
|
||||
"${REGISTRY_URL}/api/packages/${OWNER}/helm/api/charts"
|
||||
|
||||
echo "✅ Chart published successfully!"
|
||||
|
||||
- name: Summary
|
||||
if: steps.check_update.outputs.update_needed == 'true'
|
||||
|
||||
@@ -2,6 +2,6 @@ apiVersion: v2
|
||||
name: phpfpm
|
||||
description: Nginx + PHP-FPM Helm Chart with external DB and optional Selenium support
|
||||
type: application
|
||||
version: 8.5.4
|
||||
appVersion: "8.5.4"
|
||||
version: 8.5.5
|
||||
appVersion: "8.5.5"
|
||||
icon: https://upload.wikimedia.org/wikipedia/commons/thumb/2/27/PHP-logo.svg/330px-PHP-logo.svg.png
|
||||
|
||||
@@ -4,17 +4,17 @@ image:
|
||||
nginx:
|
||||
registry: docker.io
|
||||
repository: nginx
|
||||
tag: "1.29.6-alpine-perl"
|
||||
tag: "1.29.8-alpine-perl"
|
||||
pullPolicy: IfNotPresent
|
||||
php:
|
||||
registry: docker.io
|
||||
repository: php
|
||||
tag: "8.5.4-fpm-alpine3.23"
|
||||
tag: "8.5.5-fpm-alpine3.23"
|
||||
pullPolicy: IfNotPresent
|
||||
selenium:
|
||||
registry: docker.io
|
||||
repository: selenium/standalone-chromium
|
||||
tag: "145.0-chromedriver-145.0"
|
||||
tag: "147.0-chromedriver-147.0"
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
service:
|
||||
|
||||
Reference in New Issue
Block a user