You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.4 KiB

  1. name: Deploy webmvc
  2. on:
  3. workflow_dispatch:
  4. repository_dispatch:
  5. types:
  6. - deploy
  7. workflow_run:
  8. workflows: ["webmvc"]
  9. branches: [dev]
  10. types: [completed]
  11. env:
  12. CHART: webmvc
  13. NAMESPACE: eshop
  14. CHART_ROOT: deploy/k8s/helm
  15. jobs:
  16. deploy-to-k8s:
  17. if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
  18. runs-on: ubuntu-latest
  19. steps:
  20. - uses: actions/checkout@v2
  21. - uses: azure/login@v1
  22. with:
  23. creds: ${{ secrets.AZURE_CREDENTIALS }}
  24. - uses: azure/aks-set-context@v1
  25. name: Set AKS context
  26. with:
  27. creds: '${{ secrets.AZURE_CREDENTIALS }}'
  28. cluster-name: ${{ secrets.CLUSTER_NAME }}
  29. resource-group: ${{ secrets.RESOURCE_GROUP }}
  30. - name: Set branch name as env variable
  31. run: |
  32. currentbranch=$(echo ${GITHUB_REF##*/})
  33. echo "running on $currentbranch"
  34. echo "BRANCH=$currentbranch" >> $GITHUB_ENV
  35. shell: bash
  36. - name: Deploy CHART
  37. run: |
  38. ./deploy-CHART.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --NAMESPACE ${{ env.NAMESPACE }} --acr-connected
  39. env:
  40. TAG: ${{ env.BRANCH }}
  41. working-directory: ${{ env.CHART_ROOT }}