-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: release charts to ACR * fix: sleep 5min to wait for deployment of GitHub Pages
- Loading branch information
Showing
2 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
|
@@ -23,9 +23,7 @@ jobs: | |
git config user.email "[email protected]" | ||
- name: Install Helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: v3.12.1 | ||
uses: azure/[email protected] | ||
|
||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
|
@@ -35,14 +33,39 @@ jobs: | |
CR_SKIP_EXISTING: true | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
release-charts-to-acr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Helm | ||
uses: azure/[email protected] | ||
|
||
- name: Login to OCI registry | ||
run: echo '${{ secrets.ALICLOUD_PASSWORD }}' | helm registry login ${{ vars.OCI_REGISTRY_URL }} -u ${{ secrets.ALICLOUD_USERNAME }} --password-stdin | ||
|
||
- name: Package and push Helm Charts | ||
shell: bash | ||
env: | ||
OCI_REGISTRY_URL: ${{ vars.OCI_REGISTRY_URL }} | ||
OCI_NAMESPACE: ${{ vars.OCI_NAMESPACE }} | ||
run: | | ||
./scripts/release-charts-to-acr.sh | ||
release-charts-to-s3: | ||
needs: [ | ||
release, | ||
] | ||
runs-on: ubuntu-latest | ||
steps: | ||
# TODO(zyy17): Maybe it's not a elegant way to wait for GitHub Pages to update. For many scenarios, waiting for 5 minutes is enough. | ||
- name: Wait for deployment of GitHub Pages | ||
run: | | ||
sleep 300 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
OCI_REGISTRY_URL=${OCI_REGISTRY_URL:-"greptime-registry.cn-hangzhou.cr.aliyuncs.com"} | ||
OCI_NAMESPACE=${OCI_NAMESPACE:-"charts"} | ||
CHARTS_DIR="charts" | ||
|
||
for dir in "$CHARTS_DIR"/*/; do | ||
# Ensure the directory exists and is not empty. | ||
if [ -d "$dir" ]; then | ||
# Get the chart name from the directory path. | ||
chart_name=$(basename "$dir") | ||
|
||
# Package the chart, specifying the directory and output path directly. | ||
helm package "$dir" --destination "$dir" | ||
|
||
# Get the packaged chart file path. | ||
packaged_file=$(find "$dir" -type f -name "*.tgz") | ||
|
||
echo "Package $chart_name to $packaged_file and push to oci://$OCI_REGISTRY_URL/$OCI_NAMESPACE/$chart_name ..." | ||
|
||
# Push the packaged chart to the OCI repository, handling the output path. | ||
helm push "${packaged_file}" "oci://$OCI_REGISTRY_URL/$OCI_NAMESPACE" | ||
fi | ||
done |