upload-helm-charts.yaml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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-22.04
  14. strategy:
  15. fail-fast: false
  16. steps:
  17. - uses: aws-actions/configure-aws-credentials@v2
  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.1
  45. if: github.event_name == 'release' && !github.event.prerelease
  46. with:
  47. charts_dir: "${{ github.workspace }}/deploy/charts/${{ steps.profile.outputs.profile }}"
  48. version: ${{ steps.profile.outputs.version }}
  49. aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
  50. aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  51. aws_region: "us-west-2"
  52. aws_bucket_name: "repos-emqx-io"