Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatically upload harbor-helm to chart repository when having a release #1738

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/publish_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,28 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
id: install
- name: Helm Package
run: echo "PACKAGE_PATH=$(helm package ../harbor-helm | awk '{print $NF}')" >> $GITHUB_ENV
run: echo "PACKAGE_PATH=$(helm package . | awk '{print $NF}')" >> $GITHUB_ENV
- name: Publish Helm Chart
run: |
helm registry login registry-1.docker.io -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_PASSWORD }}
helm push ${{ env.PACKAGE_PATH }} oci://registry-1.docker.io/${{ secrets.DOCKER_HUB_USERNAME }}
helm registry login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
helm push ${{ env.PACKAGE_PATH }} oci://ghcr.io/${{ github.actor }}
- name: Upload to chart repository
run: |
git config --global user.email "${{ github.event.repository.name }}@users.noreply.github.com"
git config --global user.name "${{ github.event.repository.name }} CI"
git fetch origin chart-repository
git checkout chart-repository
mkdir -p ../helm-temp
cd ../helm-temp
cp ${{ env.PACKAGE_PATH }} .
helm repo index --merge ../harbor-helm/index.yaml .
mv ./* ../harbor-helm
cd ../harbor-helm
git add .
git commit -s -m "feat: Upload Harbor ${{ github.ref }} to chart repository"
git push origin chart-repository
- name: Release
uses: softprops/action-gh-release@v1
with:
Expand Down
Loading