Skip to content

Commit 4ab3e6a

Browse files
committed
separate queue function and gh monitor CD pipeline
1 parent 1d0df5e commit 4ab3e6a

File tree

4 files changed

+41
-38
lines changed

4 files changed

+41
-38
lines changed

.github/workflows/AzureFunctions-deploy.template.yml renamed to .github/workflows/AHK.GitHub.Monitor-deploy.template.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Functions TEMPLATE
1+
name: Deploy Azure Functions TEMPLATE
22

33
on:
44
# Allows this workflow to be called from the deployment workflow, but the parameters must be provided.
@@ -12,18 +12,6 @@ on:
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

2816
jobs:
2917
deploy:
@@ -40,6 +28,6 @@ jobs:
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'

.github/workflows/AHK.GitHub.Monitor-deploy.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ on:
1010

1111
env:
1212
artifactName: buildArtifact
13-
appNameEnvVar: "AHK_GitHub_Monitor_App_Name"
14-
publishProfileSecret: "AHK_GitHub_Monitor_PUBLISH_PROFILE"
15-
packageName: "Ahk.GitHub.Monitor"
1613

1714
jobs:
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.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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'

.github/workflows/AHK.GradeManagement.QueueFunction-deploy.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ on:
1010

1111
env:
1212
artifactName: buildArtifact
13-
appNameEnvVar: "AHK_GradeManagement_QueueFunction_App_Name"
14-
publishProfileSecret: "AHK_GradeManagement_QueueFunction_PUBLISH_PROFILE"
15-
packageName: "Ahk.GradeManagement.QueueFunction"
1613

1714
jobs:
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.

0 commit comments

Comments
 (0)