upload-helm-charts.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: Upload helm charts
  2. on:
  3. release:
  4. types:
  5. - published
  6. workflow_dispatch:
  7. inputs:
  8. tag:
  9. type: string
  10. required: true
  11. jobs:
  12. upload:
  13. runs-on: ubuntu-20.04
  14. strategy:
  15. fail-fast: false
  16. steps:
  17. - uses: aws-actions/configure-aws-credentials@v1-node16
  18. with:
  19. aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
  20. aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  21. aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
  22. - uses: actions/checkout@v3
  23. with:
  24. ref: ${{ github.event.inputs.tag }}
  25. - name: Detect profile
  26. id: profile
  27. run: |
  28. if git describe --tags --match '[v|e]*' --exact; then
  29. REF=$(git describe --tags --match '[v|e]*' --exact)
  30. else
  31. echo "Only release tags matching '[v|e]*' are supported"
  32. exit 1
  33. fi
  34. case "$REF" in
  35. v*)
  36. echo "profile=emqx" >> $GITHUB_OUTPUT
  37. echo "version=$(./pkg-vsn.sh emqx)" >> $GITHUB_OUTPUT
  38. ;;
  39. e*)
  40. echo "profile=emqx-enterprise" >> $GITHUB_OUTPUT
  41. echo "version=$(./pkg-vsn.sh emqx-enterprise)" >> $GITHUB_OUTPUT
  42. ;;
  43. esac
  44. - uses: emqx/push-helm-action@v1
  45. with:
  46. charts_dir: "${{ github.workspace }}/deploy/charts/${{ steps.profile.outputs.profile }}"
  47. version: ${{ steps.profile.outputs.version }}
  48. aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
  49. aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  50. aws_region: "us-west-2"
  51. aws_bucket_name: "repos-emqx-io"