-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mirroring of Helm Charts to local filesystem and Git branch
- Loading branch information
1 parent
0e16a39
commit 7d568ba
Showing
1 changed file
with
51 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: "Mirror images into local Git branch" | ||
|
||
on: | ||
push: # runs on any branch push | ||
schedule: | ||
- cron: "0 0 * * *" # runs every day at midnight | ||
workflow_dispatch: # runs whenever the workflow is dispatched via the UI | ||
|
||
env: | ||
REGISTRY_SOURCE: "charts.kubefirst.com" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
download-charts: | ||
name: "Download Helm charts to local Git repository" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout repository branch" | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: "charts" | ||
fetch-depth: 0 | ||
|
||
- name: "Install Helm mirror" | ||
run: | | ||
cd /tmp | ||
wget https://github.com/konstructio/helm-mirror/releases/download/v0.5.0/helm-mirror_linux_x86_64.tar.gz | ||
tar -xzf helm-mirror_linux_x86_64.tar.gz | ||
install -m 755 bin/mirror /usr/local/bin/helm-mirror | ||
helm-mirror -h | ||
- name: "Download a testing Chart" | ||
if: github.ref != 'refs/heads/main' | ||
run: | | ||
helm-mirror https://$REGISTRY_SOURCE "$(pwd)" --chart-name=kubefirst/kubefirst --chart-version=2.4.13 --verbose | ||
- name: "Download all Helm charts" | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
helm-mirror https://$REGISTRY_SOURCE "$(pwd)" --all-versions --verbose | ||
- name: "Commit changes" | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "GitHub Actions Bot" | ||
git add . | ||
git commit -m "Update Helm charts" | ||
git push origin charts |