Skip to content

chore: fix relative links in wraft README #15

chore: fix relative links in wraft README

chore: fix relative links in wraft README #15

Workflow file for this run

name: Release Helm Chart
on:
push:
branches: [main]
paths:
- 'charts/**'
tags:
- 'wraft-*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.14.0
- name: Package charts
run: |
mkdir -p .cr-release-packages
helm package charts/* --destination .cr-release-packages
- name: Fetch existing charts from gh-pages
run: |
# Create a temporary directory for existing charts
mkdir -p .cr-existing-packages
# Store the current commit SHA to return to it later
ORIGINAL_SHA=$(git rev-parse HEAD)
# Try to fetch existing charts from gh-pages branch
if git ls-remote --exit-code --heads origin gh-pages; then
echo "gh-pages branch exists, fetching existing charts..."
git fetch origin gh-pages || true
git checkout FETCH_HEAD || true
# Copy existing .tgz files if they exist
if ls *.tgz 1> /dev/null 2>&1; then
cp *.tgz .cr-existing-packages/ || true
fi
# Copy existing index.yaml if it exists
if [ -f index.yaml ]; then
cp index.yaml .cr-existing-packages/ || true
fi
# Switch back to original commit
git checkout $ORIGINAL_SHA
else
echo "gh-pages branch doesn't exist yet, this will be the first release"
fi
- name: Merge existing and new charts
run: |
# Copy existing charts to release packages directory
if [ -d .cr-existing-packages ] && [ "$(ls -A .cr-existing-packages/*.tgz 2>/dev/null)" ]; then
echo "Copying existing charts..."
cp .cr-existing-packages/*.tgz .cr-release-packages/ || true
fi
- name: Generate comprehensive index.yaml
run: |
# Generate index.yaml for all charts (existing + new)
helm repo index .cr-release-packages --url https://wraft.github.io/charts
# If there was an existing index.yaml, merge it with the new one
if [ -f .cr-existing-packages/index.yaml ]; then
echo "Merging with existing index.yaml..."
helm repo index .cr-release-packages --url https://wraft.github.io/charts --merge .cr-existing-packages/index.yaml
fi
# Add .nojekyll file to disable Jekyll processing
touch .cr-release-packages/.nojekyll
- name: Push to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: .cr-release-packages
keep_files: false # We're manually managing files, so don't keep old ones
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: .cr-release-packages/*.tgz
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}