File tree Expand file tree Collapse file tree 4 files changed +41
-38
lines changed
Expand file tree Collapse file tree 4 files changed +41
-38
lines changed Original file line number Diff line number Diff line change 1- name : Deploy Functions TEMPLATE
1+ name : Deploy Azure Functions TEMPLATE
22
33on :
44 # Allows this workflow to be called from the deployment workflow, but the parameters must be provided.
1212 description : The name of the environment to deploy to.
1313 required : true
1414 type : string
15- packageName :
16- description : The name of the package from the artifact to deploy.
17- required : true
18- type : string
19- appNameEnvVar :
20- description : The name of the environment variable that contains the Azure Function app name.
21- required : true
22- type : string
23- publishProfileSecret :
24- description : The name of the secret that contains the Azure Function publish profile.
25- required : true
26- type : string
2715
2816jobs :
2917 deploy :
4028 uses : Azure/functions-action@v1
4129 id : fa
4230 with :
43- app-name : ${{ vars[inputs.appNameEnvVar] || env[inputs.appNameEnvVar] }}
44- publish-profile : ${{ secrets[inputs.publishProfileSecret] }}
45- package : ' ./${{ inputs.artifactName }}/${{ inputs.packageName }} '
31+ app-name : ${{ env.AHK_GitHub_Monitor_App_Name }}
32+ publish-profile : ${{ secrets.AHK_GitHub_Monitor_PUBLISH_PROFILE }}
33+ package : ' ./${{ inputs.artifactName }}/Ahk.GitHub.Monitor '
Original file line number Diff line number Diff line change 1010
1111env :
1212 artifactName : buildArtifact
13- appNameEnvVar : " AHK_GitHub_Monitor_App_Name"
14- publishProfileSecret : " AHK_GitHub_Monitor_PUBLISH_PROFILE"
15- packageName : " Ahk.GitHub.Monitor"
1613
1714jobs :
1815 # 👇 Call the build workflow to create the artifacts to deploy, and provide the artifact name.
@@ -24,22 +21,16 @@ jobs:
2421
2522 deploy-to-test :
2623 needs : build
27- uses : ./.github/workflows/AzureFunctions -deploy.template.yml
24+ uses : ./.github/workflows/AHK.GitHub.Monitor -deploy.template.yml
2825 with :
2926 environmentName : test
3027 artifactName : ${{ github.env.artifactName }}
31- packageName : ${{ github.env.packageName }}
32- appNameEnvVar : ${{ github.env.appNameEnvVar }}
33- publishProfileSecret : ${{ github.env.publishProfileSecret }}
3428 secrets : inherit # Pass repository secrets to the deployment workflow.
3529
3630 deploy-to-production :
3731 needs : deploy-to-test
38- uses : ./.github/workflows/AzureFunctions -deploy.template.yml
32+ uses : ./.github/workflows/AHK.GitHub.Monitor -deploy.template.yml
3933 with :
4034 environmentName : production
4135 artifactName : ${{ github.env.artifactName }}
42- packageName : ${{ github.env.packageName }}
43- appNameEnvVar : ${{ github.env.appNameEnvVar }}
44- publishProfileSecret : ${{ github.env.publishProfileSecret }}
4536 secrets : inherit # Pass repository secrets to the deployment workflow.
Original file line number Diff line number Diff line change 1+ name : Deploy Azure Functions TEMPLATE
2+
3+ on :
4+ # Allows this workflow to be called from the deployment workflow, but the parameters must be provided.
5+ workflow_call :
6+ inputs :
7+ artifactName :
8+ description : The name of the artifact to download and deploy.
9+ required : true
10+ type : string
11+ environmentName :
12+ description : The name of the environment to deploy to.
13+ required : true
14+ type : string
15+
16+ jobs :
17+ deploy :
18+ runs-on : ubuntu-latest
19+ environment : ${{ inputs.environmentName }}
20+ steps :
21+ - name : Download artifact
22+ uses : actions/download-artifact@v4
23+ with :
24+ name : ${{ inputs.artifactName }}
25+ path : .
26+
27+ - name : " Run Azure Functions deploy action using publish profile credentials"
28+ uses : Azure/functions-action@v1
29+ id : fa
30+ with :
31+ app-name : ${{ env.AHK_GradeManagement_QueueFunction_App_Name }}
32+ publish-profile : ${{ secrets.AHK_GradeManagement_QueueFunction_Publish_Profile }}
33+ package : ' ./${{ inputs.artifactName }}/Ahk.GradeManagement.QueueFunction'
Original file line number Diff line number Diff line change 1010
1111env :
1212 artifactName : buildArtifact
13- appNameEnvVar : " AHK_GradeManagement_QueueFunction_App_Name"
14- publishProfileSecret : " AHK_GradeManagement_QueueFunction_PUBLISH_PROFILE"
15- packageName : " Ahk.GradeManagement.QueueFunction"
1613
1714jobs :
1815 # 👇 Call the build workflow to create the artifacts to deploy, and provide the artifact name.
@@ -24,22 +21,16 @@ jobs:
2421
2522 deploy-to-test :
2623 needs : build
27- uses : ./.github/workflows/AzureFunctions -deploy.template.yml
24+ uses : ./.github/workflows/AHK.GradeManagement.QueueFunction -deploy.template.yml
2825 with :
2926 environmentName : test
3027 artifactName : ${{ github.env.artifactName }}
31- packageName : ${{ github.env.packageName }}
32- appNameEnvVar : ${{ github.env.appNameEnvVar }}
33- publishProfileSecret : ${{ github.env.publishProfileSecret }}
3428 secrets : inherit # Pass repository secrets to the deployment workflow.
3529
3630 deploy-to-production :
3731 needs : deploy-to-test
38- uses : ./.github/workflows/AzureFunctions -deploy.template.yml
32+ uses : ./.github/workflows/AHK.GradeManagement.QueueFunction -deploy.template.yml
3933 with :
4034 environmentName : production
4135 artifactName : ${{ github.env.artifactName }}
42- packageName : ${{ github.env.packageName }}
43- appNameEnvVar : ${{ github.env.appNameEnvVar }}
44- publishProfileSecret : ${{ github.env.publishProfileSecret }}
4536 secrets : inherit # Pass repository secrets to the deployment workflow.
You can’t perform that action at this time.
0 commit comments