Skip to content

Commit 03baf65

Browse files
authored
Merge branch 'main' into 1022-yuluo/helm
2 parents a5763af + 860c4c8 commit 03baf65

File tree

11 files changed

+263
-198
lines changed

11 files changed

+263
-198
lines changed

.github/workflows/k8s-config-test.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ jobs:
1818
- name: Checkout code
1919
uses: actions/checkout@v4
2020

21-
- name: Install Kustomize
22-
run: |
23-
echo "Installing Kustomize ${{ inputs.kustomize_version }}..."
24-
# Use the official installation script for better reliability
25-
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
26-
sudo mv kustomize /usr/local/bin/
27-
kustomize version
21+
- name: Setup Kubernetes tools
22+
uses: ./tools/github-action/setup-kubetools
23+
with:
24+
kubectl_version: v1.28.0
25+
kustomize_version: ${{ inputs.kustomize_version }}
2826

2927
- name: Test kustomize with different overlays
3028
run: |

.github/workflows/k8s-kind-integration-test.yml

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,18 @@ jobs:
2424
- name: Checkout code
2525
uses: actions/checkout@v4
2626

27-
- name: Free up disk space before build
28-
run: |
29-
echo "=== Initial disk usage ==="
30-
df -h
31-
echo ""
32-
echo "=== Cleaning up system ==="
33-
# Remove unnecessary packages and caches
34-
sudo apt-get clean
35-
sudo apt-get autoremove -y
36-
sudo rm -rf /var/lib/apt/lists/*
37-
sudo rm -rf /tmp/*
38-
sudo rm -rf /var/tmp/*
39-
40-
# Clean Docker system
41-
docker system prune -af --volumes
42-
43-
# Remove large unnecessary files/directories
44-
sudo rm -rf /usr/share/dotnet
45-
sudo rm -rf /usr/local/lib/android
46-
sudo rm -rf /opt/ghc
47-
sudo rm -rf /opt/hostedtoolcache/CodeQL
48-
49-
echo ""
50-
echo "=== Disk usage after cleanup ==="
51-
df -h
27+
- name: Cleanup disk space (CI)
28+
uses: ./tools/github-action/cleanup-disk
5229

5330
- name: Set up Docker Buildx
5431
uses: docker/setup-buildx-action@v3
5532

33+
- name: Setup Kubernetes tools
34+
uses: ./tools/github-action/setup-kubetools
35+
with:
36+
kubectl_version: v1.28.0
37+
kustomize_version: ${{ inputs.kustomize_version }}
38+
5639
- name: Generate kind configuration for CI
5740
run: |
5841
echo "Creating CI-optimized kind configuration..."
@@ -147,13 +130,8 @@ jobs:
147130
echo "=== Node resources ==="
148131
kubectl describe nodes
149132
150-
- name: Install Kustomize
151-
run: |
152-
echo "Installing Kustomize ${{ inputs.kustomize_version }}..."
153-
# Use the official installation script for better reliability
154-
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
155-
sudo mv kustomize /usr/local/bin/
156-
kustomize version
133+
- name: Ensure kustomize available
134+
run: kustomize version
157135

158136
- name: Prepare CI deployment
159137
run: |

.github/workflows/k8s-security-scan.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ jobs:
1818
- name: Checkout code
1919
uses: actions/checkout@v4
2020

21-
- name: Install Kustomize
22-
run: |
23-
echo "Installing Kustomize ${{ inputs.kustomize_version }}..."
24-
# Use the official installation script for better reliability
25-
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
26-
sudo mv kustomize /usr/local/bin/
27-
kustomize version
21+
- name: Setup Kubernetes tools
22+
uses: ./tools/github-action/setup-kubetools
23+
with:
24+
kubectl_version: v1.28.0
25+
kustomize_version: ${{ inputs.kustomize_version }}
2826

2927
- name: Run Trivy security scan
3028
uses: aquasecurity/trivy-action@master

.github/workflows/k8s-shared-config.yml

Lines changed: 0 additions & 145 deletions
This file was deleted.

.github/workflows/k8s-validate-manifests.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ jobs:
1818
- name: Checkout code
1919
uses: actions/checkout@v4
2020

21-
- name: Install Kustomize
22-
run: |
23-
echo "Installing Kustomize ${{ inputs.kustomize_version }}..."
24-
# Use the official installation script for better reliability
25-
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
26-
sudo mv kustomize /usr/local/bin/
27-
kustomize version
21+
- name: Setup Kubernetes tools
22+
uses: ./tools/github-action/setup-kubetools
23+
with:
24+
kubectl_version: v1.28.0
25+
kustomize_version: ${{ inputs.kustomize_version }}
2826

2927
- name: Validate Kustomize build
3028
run: |
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Cleanup disk space (CI)"
2+
description: "Free disk space on GitHub runner and prune Docker cache"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Free up disk space before build
7+
shell: bash
8+
run: |
9+
set -euo pipefail
10+
echo "=== Initial disk usage ==="
11+
df -h || true
12+
echo ""
13+
echo "=== Cleaning up system ==="
14+
sudo apt-get clean || true
15+
sudo apt-get autoremove -y || true
16+
sudo rm -rf /var/lib/apt/lists/* || true
17+
sudo rm -rf /tmp/* || true
18+
sudo rm -rf /var/tmp/* || true
19+
20+
docker system prune -af --volumes || true
21+
22+
sudo rm -rf /usr/share/dotnet || true
23+
sudo rm -rf /usr/local/lib/android || true
24+
sudo rm -rf /opt/ghc || true
25+
sudo rm -rf /opt/hostedtoolcache/CodeQL || true
26+
27+
echo ""
28+
echo "=== Disk usage after cleanup ==="
29+
df -h || true
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Setup Kubernetes tools"
2+
description: "Install kubectl and kustomize with pinned versions"
3+
inputs:
4+
kubectl_version:
5+
description: "Version of kubectl to install"
6+
required: false
7+
default: "v1.28.0"
8+
kustomize_version:
9+
description: "Version of kustomize to install"
10+
required: false
11+
default: "v5.7.1"
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Install kubectl
16+
shell: bash
17+
run: |
18+
set -euo pipefail
19+
curl -LO "https://dl.k8s.io/release/${{ inputs.kubectl_version }}/bin/linux/amd64/kubectl"
20+
chmod +x kubectl
21+
sudo mv kubectl /usr/local/bin/
22+
kubectl version --client
23+
- name: Install kustomize
24+
shell: bash
25+
run: |
26+
set -euo pipefail
27+
echo "Installing Kustomize ${{ inputs.kustomize_version }}..."
28+
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
29+
sudo mv kustomize /usr/local/bin/
30+
kustomize version
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import React, { useEffect, useState } from 'react'
2+
import styles from './styles.module.css'
3+
4+
export default function ScrollToTop(): React.ReactElement {
5+
const [isVisible, setIsVisible] = useState(false)
6+
7+
useEffect(() => {
8+
const toggleVisibility = () => {
9+
if (window.pageYOffset > 300) {
10+
setIsVisible(true)
11+
}
12+
else {
13+
setIsVisible(false)
14+
}
15+
}
16+
17+
window.addEventListener('scroll', toggleVisibility)
18+
19+
return () => {
20+
window.removeEventListener('scroll', toggleVisibility)
21+
}
22+
}, [])
23+
24+
const scrollToTop = () => {
25+
window.scrollTo({
26+
top: 0,
27+
behavior: 'smooth',
28+
})
29+
}
30+
31+
return (
32+
<>
33+
{isVisible && (
34+
<button
35+
onClick={scrollToTop}
36+
className={styles.scrollToTop}
37+
aria-label="Scroll to top"
38+
>
39+
<svg
40+
width="24"
41+
height="24"
42+
viewBox="0 0 24 24"
43+
fill="none"
44+
xmlns="http://www.w3.org/2000/svg"
45+
>
46+
<path
47+
d="M12 19V5M12 5L5 12M12 5L19 12"
48+
stroke="currentColor"
49+
strokeWidth="2"
50+
strokeLinecap="round"
51+
strokeLinejoin="round"
52+
/>
53+
</svg>
54+
</button>
55+
)}
56+
</>
57+
)
58+
}

0 commit comments

Comments
 (0)