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.

49 lines
1.4 KiB

3 years ago
3 years ago
  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. if: false
  19. runs-on: ubuntu-latest
  20. steps:
  21. - uses: actions/checkout@v2
  22. - uses: azure/login@v1
  23. with:
  24. creds: ${{ secrets.AZURE_CREDENTIALS }}
  25. - uses: azure/aks-set-context@v1
  26. name: Set AKS context
  27. with:
  28. creds: '${{ secrets.AZURE_CREDENTIALS }}'
  29. cluster-name: ${{ secrets.CLUSTER_NAME }}
  30. resource-group: ${{ secrets.RESOURCE_GROUP }}
  31. - name: Set branch name as env variable
  32. run: |
  33. currentbranch=$(echo ${GITHUB_REF##*/})
  34. echo "running on $currentbranch"
  35. echo "BRANCH=$currentbranch" >> $GITHUB_ENV
  36. shell: bash
  37. - name: Deploy Chart
  38. run: |
  39. ./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
  40. env:
  41. TAG: ${{ env.BRANCH }}
  42. working-directory: ${{ env.CHART_ROOT }}