Skip to content

Commit

Permalink
Feat: update ci for publishing
Browse files Browse the repository at this point in the history
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
  • Loading branch information
Somefive committed Jun 2, 2023
1 parent cd8f883 commit e5d9a72
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions .github/workflows/chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ jobs:
echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
fi
echo ::set-output name=GITVERSION::git-$(git rev-parse --short HEAD)
- name: Login ghcr.io
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login Docker Hub
uses: docker/login-action@v1
with:
Expand All @@ -51,11 +57,11 @@ jobs:
GIT_VERSION=${{ steps.vars.outputs.GITVERSION }}
tags: |-
docker.io/oamdev/vela-workflow:${{ steps.vars.outputs.TAG }}
ghcr.io/${{ github.repository_owner }}/oamdev/vela-workflow:${{ steps.vars.outputs.TAG }}
publish-charts:
env:
HELM_CHART: charts/vela-workflow
LOCAL_OSS_DIRECTORY: .oss/
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
Expand Down Expand Up @@ -93,15 +99,22 @@ jobs:
sed -i "s/latest/${image_tag}/g" $HELM_CHART/values.yaml
chart_smever=${chart_version#"v"}
sed -i "s/0.1.0/$chart_smever/g" $HELM_CHART/Chart.yaml
- name: Install ossutil
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
- name: Configure Alibaba Cloud OSSUTIL
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT} -c .ossutilconfig
- name: sync cloud to local
run: ./ossutil --config-file .ossutilconfig sync oss://$BUCKET/core $LOCAL_OSS_DIRECTORY
- name: Package helm charts
- uses: jnwng/github-app-installation-token-action@v2
id: get_app_token
with:
appId: 340472
installationId: 38064967
privateKey: ${{ secrets.GH_KUBEVELA_APP_PRIVATE_KEY }}
- name: Sync Chart Repo
run: |
helm package $HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm repo index --url https://$BUCKET.$ENDPOINT/core $LOCAL_OSS_DIRECTORY
- name: sync local to cloud
run: ./ossutil --config-file .ossutilconfig sync $LOCAL_OSS_DIRECTORY oss://$BUCKET/core -f
git config --global user.email "135009839+kubevela[bot]@users.noreply.github.com"
git config --global user.name "kubevela[bot]"
git clone https://x-access-token:${{ steps.get_app_token.outputs.token }}@github.com/kubevela/charts.git kubevela-charts
helm package $HELM_CHART --destination ./kubevela-charts/docs/
helm repo index --url https://kubevela.github.io/charts ./kubevela-charts/docs/
cd kubevela-charts/
git add docs/
chart_version=${GITHUB_REF#refs/tags/}
git commit -m "update vela-workflow chart ${chart_version}"
git push https://x-access-token:${{ steps.get_app_token.outputs.token }}@github.com/kubevela/charts.git

0 comments on commit e5d9a72

Please sign in to comment.