Skip to content

Commit c37d017

Browse files
authored
workflows 1
1 parent c9178f5 commit c37d017

10 files changed

+79
-197
lines changed

.github/workflows/build-Build-AHK.GradeManagement.yml renamed to .github/workflows/AHK.GradeManagement-build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
# Run workflow on pushes to any branch, except the main branch.
88
# push:
9-
# branches-ignore: main
9+
# branches-ignore: dev
1010

1111
# Allows you to run this workflow manually from the Actions tab.
1212
workflow_dispatch:
@@ -41,7 +41,8 @@ jobs:
4141

4242
- name: "Run dotnet publish"
4343
working-directory: src/Ahk.GradeManagement
44-
run: dotnet publish Ahk.GradeManagement.Api/Ahk.GradeManagement.Api.csproj --configuration Release --output ./output/Ahk.GradeManagement.Api
44+
run: dotnet publish Ahk.GradeManagement.Api/Ahk.GradeManagement.Api.csproj --configuration Release --property:PublishDir='./output/Ahk.GradeManagement.Api'
45+
./output/Ahk.GradeManagement.Api
4546

4647
- name: Upload artifact
4748
uses: actions/upload-artifact@v4
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy TEMPLATE AHK.GradeManagement
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+
17+
jobs:
18+
deploy:
19+
runs-on: ubuntu-latest
20+
# 👇 Allows using variables and secrets defined in the provided environment.
21+
environment: ${{ inputs.environmentName }}
22+
steps:
23+
- name: Download artifact
24+
uses: actions/download-artifact@v4
25+
with:
26+
name: ${{ inputs.artifactName }}
27+
path: ./buildArtifact
28+
29+
# Deploy to Azure Web apps
30+
- name: 'Run Azure webapp deploy action using publish profile credentials'
31+
uses: azure/webapps-deploy@v3
32+
with:
33+
app-name: ${{ env.AHK_GradeManagement_App_Name }} # Replace with your app name
34+
publish-profile: ${{ secrets.AHK_GradeManagement_PUBLISH_PROFILE }} # Define secret variable in repository settings as per action documentation
35+
package: '${{ ./buildArtifact }}/AHK.GradeManagement.Api'
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy AHK.GradeManagement
2+
3+
on:
4+
# Trigger the workflow on a push to the main branch.
5+
push:
6+
branches: dev
7+
8+
# Allows you to run this workflow manually (for any branch) from the Actions tab.
9+
workflow_dispatch:
10+
11+
env:
12+
# 👇 Set the artifact name that will be used by the build and deployments, so it is now only defined in one place.
13+
artifactName: buildArtifact
14+
15+
jobs:
16+
# 👇 Call the build workflow to create the artifacts to deploy, and provide the artifact name.
17+
build:
18+
uses: ./.github/workflows/5-include-with-deploy-template--build.yml
19+
with:
20+
artifactName: ${{ github.env.artifactName }}
21+
secrets: inherit # Pass secrets to the build workflow, if necessary.
22+
23+
deploy-to-test:
24+
# Only run this deploy job after the build-and-test job completes successfully.
25+
needs: build
26+
# 👇 Call the deploy template with the proper environment name to deploy the artifacts.
27+
uses: ./.github/workflows/AHK.GradeManagement-deploy.template.yml
28+
with:
29+
artifactName: ${{ github.env.artifactName }}
30+
environmentName: test
31+
secrets: inherit # Pass repository secrets to the deployment workflow.
32+
33+
deploy-to-production:
34+
# Only run this deploy job after the deploy-to-test job completes successfully.
35+
needs: deploy-to-test
36+
# 👇 Call the deploy template with the proper environment name to deploy the artifacts.
37+
uses: ./.github/workflows/AHK.GradeManagement-deploy.template.yml
38+
with:
39+
artifactName: ${{ github.env.artifactName }}
40+
environmentName: production
41+
secrets: inherit # Pass repository secrets to the deployment workflow.

.github/workflows/grade-management-azure-publish.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/grade-management-build.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/grade-management-new-build.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/publish-result-pr-build.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/publish-result-pr-docker-publish.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/review-ui-azure-publish.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/review-ui-build.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)