@@ -13,7 +13,7 @@ concurrency:
1313
1414permissions :
1515 contents : read
16- pull-requests : ' write'
16+ pull-requests : write
1717
1818env :
1919 IMAGE_NAME : net-core-tool-service
@@ -33,46 +33,55 @@ jobs:
3333 with :
3434 fetch-depth : 0 # avoid shallow clone so nbgv can do its work.
3535
36- - name : Login to Azure
37- uses : azure/login@v1
38- with :
39- creds : ${{ secrets.AZURE_CREDENTIALS }}
36+ - name : Detect template source from PR body
37+ run : |
38+ CheckoutTarget = grep "template_checkout_target=" github.event.pull_request.body | awk '{print $2}'
39+ if [[ $CheckoutTarget ]]; then
40+ echo "Found checkout target '$CheckoutTarget' in PR body, using include templates from source."
41+ echo "{TEMPLATE_CHECKOUT_TARGET}=$CheckoutTarget" >> "$GITHUB_ENV"
42+ else
43+ echo "Did not find a checkout target for templates."
44+ fi
4045
41- - name : Login to container registry
42- uses : azure/docker-login@v1
43- with :
44- login-server : " ${{ vars.DOCKER_REGISTRY }}"
45- username : " ${{ secrets.DOCKER_USERNAME }}"
46- password : " ${{ secrets.DOCKER_PASSWORD }}"
46+ # - name: Login to Azure
47+ # uses: azure/login@v1
48+ # with:
49+ # creds: ${{ secrets.AZURE_CREDENTIALS }}
4750
48- - name : Build image
49- run : docker build . --file "Dockerfile" -t ${{ vars.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
51+ # - name: Login to container registry
52+ # uses: azure/docker-login@v1
53+ # with:
54+ # login-server: "${{ vars.DOCKER_REGISTRY }}"
55+ # username: "${{ secrets.DOCKER_USERNAME }}"
56+ # password: "${{ secrets.DOCKER_PASSWORD }}"
5057
51- - name : Push image
52- run : docker push ${{ vars.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
58+ # - name: Build image
59+ # run: docker build . -t ${{ vars.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} --build-arg TEMPLATE_CHECKOUT_TARGET=${{ env.TEMPLATE_CHECKOUT_TARGET }}
5360
54- - name : If PR, create a new staging slot
55- if : ${{ github.event_name == 'pull_request' }}
56- run : az webapp deployment slot create --resource-group ${{ vars.AZURE_RESOURCE_GROUP }} --name ${{ vars.AZURE_WEBAPP_NAME}} --slot ${{ env.SLOT_NAME }} --configuration-source ${{ vars.STAGING_SLOT_NAME }}
61+ # - name: Push image
62+ # run: docker push ${{ vars.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
5763
58- - name : Deploy to staging slot
59- uses : azure/webapps-deploy@v3
60- id : deploy-to-webapp
61- with :
62- app-name : ${{ vars.AZURE_WEBAPP_NAME }}
63- images : ${{ vars.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
64- slot-name : ${{ env.SLOT_NAME }}
64+ # - name: If PR, create a new staging slot
65+ # if: ${{ github.event_name == 'pull_request' }}
66+ # run: az webapp deployment slot create --resource-group ${{ vars.AZURE_RESOURCE_GROUP }} --name ${{ vars.AZURE_WEBAPP_NAME}} --slot ${{ env.SLOT_NAME }} --configuration-source ${{ vars.STAGING_SLOT_NAME }}
67+
68+ # - name: Deploy to staging slot
69+ # uses: azure/webapps-deploy@v3
70+ # id: deploy-to-webapp
71+ # with:
72+ # app-name: ${{ vars.AZURE_WEBAPP_NAME }}
73+ # images: ${{ vars.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
74+ # slot-name: ${{ env.SLOT_NAME }}
6575
66- - name : If PR, comment with the preview link
67- if : ${{ github.event_name == 'pull_request' }}
68- uses : mshick/add-pr-comment@v2
69- with :
70- message : |
71- ## Preview link: https://${{ vars.AZURE_WEBAPP_NAME }}-${{ env.SLOT_NAME }}.azurewebsites.net
76+ # - name: If PR, comment with the preview link
77+ # if: ${{ github.event_name == 'pull_request' }}
78+ # uses: mshick/add-pr-comment@v2
79+ # with:
80+ # message: |
81+ # ## Preview link: https://${{ vars.AZURE_WEBAPP_NAME }}-${{ env.SLOT_NAME }}.azurewebsites.net
7282
73- - Your changes have been deployed to the preview site. The preview site will update as you add more commits to this branch.
74- - The preview link is shareable, but will be deleted when the pull request is merged or closed.
83+ # - Your changes have been deployed to the preview site. The preview site will update as you add more commits to this branch.
84+ # - The preview link is shareable, but will be deleted when the pull request is merged or closed.
7585
76- > *This is an automated message.*
77- repo-token : ${{ secrets.GITHUB_TOKEN }}
78-
86+ # > *This is an automated message.*
87+ # repo-token: ${{ secrets.GITHUB_TOKEN }}
0 commit comments