Skip to content

Commit c54a1e9

Browse files
authored
Merge pull request #59 from kube-HPC/hkubectl_updates_via_workflow
Update hkubectl download files via workflow when hkubectl updates
2 parents 0a7e06f + 07a1ff6 commit c54a1e9

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Update Download Files from hkubectl Release
2+
3+
# Trigger the workflow when a new release is published in the hkubectl repository
4+
on:
5+
repository_dispatch:
6+
types: [hkubectl-release]
7+
8+
jobs:
9+
update-files:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout kube-HPC.github.io repository
14+
uses: actions/checkout@v2
15+
with:
16+
repository: kube-HPC/kube-HPC.github.io
17+
ref: source
18+
19+
- name: Download latest release files from hkubectl
20+
run: |
21+
set -e
22+
export latestVersion=$(curl -s https://api.github.com/repos/kube-HPC/hkubectl/releases/latest | jq -r .tag_name)
23+
mkdir -p site/hkubectl_files
24+
curl -L --retry 3 --retry-delay 5 https://github.com/kube-HPC/hkubectl/releases/download/${latestVersion}/hkubectl-linux -o site/hkubectl_files/hkubectl-linux
25+
curl -L --retry 3 --retry-delay 5 https://github.com/kube-HPC/hkubectl/releases/download/${latestVersion}/hkubectl-macos -o site/hkubectl_files/hkubectl-macos
26+
curl -L --retry 3 --retry-delay 5 https://github.com/kube-HPC/hkubectl/releases/download/${latestVersion}/hkubectl-win.exe -o site/hkubectl_files/hkubectl-win.exe
27+
28+
- name: Commit and push updated files to kube-HPC.github.io
29+
run: |
30+
git config --global user.email "[email protected]"
31+
git config --global user.name "GitHub Action"
32+
git checkout source || git checkout -b source origin/source
33+
git add -A
34+
if ! git diff --cached --quiet; then
35+
git commit -m "Update hkubectl download files to the latest release"
36+
git push origin source
37+
else
38+
echo "No changes to commit, skipping commit and push."
39+
fi
40+

0 commit comments

Comments
 (0)