File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 2
2
name : Deploy Jekyll with GitHub Pages dependencies preinstalled
3
3
4
4
on :
5
- # Runs on pushes targeting the default branch
6
- push :
7
- branches : ["main"]
8
-
9
5
# Allows you to run this workflow manually from the Actions tab
10
6
workflow_dispatch :
11
7
repository_dispatch :
42
38
destination : ./_site
43
39
- name : Helm package
44
40
run : |
45
- bash helm.sh
41
+ if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then
42
+ bash helm.sh ${{ github.event.client_payload.ref }}
43
+ elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
44
+ bash helm.sh
45
+ fi
46
46
sudo cp index.yaml _site/
47
47
- name : Upload artifact
48
48
uses : actions/upload-pages-artifact@v1
Original file line number Diff line number Diff line change 3
3
# 仓库名称
4
4
repository=" labring/endpoints-operator"
5
5
6
- # 获取最新release的版本号
7
- latest_release=$( curl -s " https://api.github.com/repos/$repository /releases/latest" | grep ' "tag_name":' | sed -E ' s/.*"([^"]+)".*/\1/' )
6
+ # 版本号参数
7
+ version=$1
8
+
9
+ if [[ -z " $version " ]]; then
10
+ # 获取最新release的版本号
11
+ version=$( curl -s " https://api.github.com/repos/$repository /releases/latest" | grep ' "tag_name":' | sed -E ' s/.*"([^"]+)".*/\1/' )
12
+ fi
13
+
8
14
# 构建下载链接
9
- download_url=" https://github.com/$repository /releases/download/$latest_release /endpoints-operator-${latest_release # v} .tgz"
15
+ download_url=" https://github.com/$repository /releases/download/$version /endpoints-operator-${version # v} .tgz"
10
16
11
- # 下载最新release
17
+ # 下载指定版本的release
12
18
wget $download_url
13
19
14
- helm repo index . --url https://github.com/$repository /releases/download/$latest_release
20
+ helm repo index . --url https://github.com/$repository /releases/download/$version
You can’t perform that action at this time.
0 commit comments