-
Notifications
You must be signed in to change notification settings - Fork 55
38 lines (36 loc) · 1.71 KB
/
deploy-to-oss.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Deploy Artifacts to OSS
on:
push:
tags:
- "v*.*.*"
jobs:
deploy-to-oss:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Aliyun CLI
run: |
curl -O https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz
tar -xzf aliyun-cli-linux-latest-amd64.tgz
chmod +x aliyun
./aliyun version
- name: Download Helm Charts Index
run: ./aliyun oss cp oss://higress-website-cn-hongkong/helm-charts/index.yaml ./artifact/ -f -e oss-cn-hongkong.aliyuncs.com --access-key-id ${{ secrets.ACCESS_KEYID }} --access-key-secret ${{ secrets.ACCESS_KEYSECRET }} --region cn-hongkong
- id: calc-version
name: Calculate Version Number
run: |
version=$(echo ${{ github.ref_name }} | cut -c2-)
echo "Version=$version"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Build Artifact
uses: stefanprodan/kube-tools@v1
with:
helmv3: 3.7.2
command: |
helmv3 package helm --debug --app-version ${{steps.calc-version.outputs.version}} --version ${{steps.calc-version.outputs.version}} -d ./artifact
helmv3 repo index --url https://higress.io/helm-charts/ --merge ./artifact/index.yaml ./artifact
cp ./artifact/index.yaml ./artifact/cn-index.yaml
sed -i 's/higress\.io/higress\.cn/g' ./artifact/cn-index.yaml
- name: Upload to OSS
run: ./aliyun oss cp ./artifact/ oss://higress-website-cn-hongkong/helm-charts/ -r -f -e oss-cn-hongkong.aliyuncs.com --access-key-id ${{ secrets.ACCESS_KEYID }} --access-key-secret ${{ secrets.ACCESS_KEYSECRET }} --region cn-hongkong