Skip to content

Commit 652dd51

Browse files
committed
wip
1 parent 223b84d commit 652dd51

File tree

101 files changed

+127
-470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+127
-470
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy TEMPLATE AHK.GitHub.Monitor
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_GitHub_Monitor_App_Name }} # Replace with your app name
32+
publish-profile: ${{ secrets.AHK_GitHub_Monitor_PUBLISH_PROFILE }} # Define secret variable in repository settings as per action documentation
33+
package: './buildArtifact/Ahk.GitHub.Monitor'
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy AHK.GitHub.Monitor
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+
artifactName: buildArtifact
13+
14+
jobs:
15+
# 👇 Call the build workflow to create the artifacts to deploy, and provide the artifact name.
16+
build:
17+
uses: ./.github/workflows/AHK.GitHub.Monitor-build.yml
18+
with:
19+
artifactName: ${{ github.env.artifactName }}
20+
secrets: inherit # Pass secrets to the build workflow, if necessary.
21+
22+
deploy-to-test:
23+
needs: build
24+
uses: ./.github/workflows/AHK.GitHub.Monitor-deploy.template.yml
25+
with:
26+
artifactName: ${{ github.env.artifactName }}
27+
environmentName: test
28+
secrets: inherit # Pass repository secrets to the deployment workflow.
29+
30+
deploy-to-production:
31+
needs: deploy-to-test
32+
uses: ./.github/workflows/AHK.GitHub.Monitor-deploy.template.yml
33+
with:
34+
artifactName: ${{ github.env.artifactName }}
35+
environmentName: production
36+
secrets: inherit # Pass repository secrets to the deployment workflow.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build AHK.GitHub.Monitor
2+
3+
on:
4+
pull_request:
5+
branches: dev # Run workflow on PRs to the main branch.
6+
7+
# Run workflow on pushes to any branch, except the main branch.
8+
# push:
9+
# branches-ignore: dev
10+
11+
# Allows you to run this workflow manually from the Actions tab.
12+
workflow_dispatch:
13+
14+
# 👇 Allows this workflow to be called from the deployment workflow, but the parameters must be provided.
15+
workflow_call:
16+
inputs:
17+
artifactName:
18+
description: The name of the artifact to upload to.
19+
required: true
20+
type: string
21+
22+
env:
23+
# 👇 Provide a default artifact name for when this workflow is not called by the deployment workflow.
24+
artifactName: ${{ inputs.artifactName || 'buildArtifact' }}
25+
26+
jobs:
27+
build-and-test:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout the repo source code
31+
uses: actions/checkout@v3
32+
33+
- name: Setup dotnet
34+
uses: actions/setup-dotnet@v1
35+
with:
36+
dotnet-version: "9.0.x"
37+
38+
- name: "Run dotnet restore"
39+
working-directory: src/Ahk.Github.Monitor
40+
run: dotnet restore Ahk.Github.Monitor.sln
41+
42+
- name: "Run dotnet build"
43+
working-directory: src/Ahk.Github.Monitor
44+
run: dotnet build Ahk.Github.Monitor.sln --no-restore --configuration Release
45+
46+
- name: "Run dotnet test"
47+
working-directory: src/Ahk.Github.Monitor
48+
run: dotnet test Ahk.Github.Monitor.sln --no-restore --no-build --configuration Release
49+
50+
- name: "Run dotnet publish"
51+
working-directory: src/Ahk.Github.Monitor
52+
run: dotnet publish Ahk.Github.Monitor/Ahk.Github.Monitor.csproj --no-restore --configuration Release --output '${{ github.workspace }}/output/Ahk.Github.Monitor'
53+
54+
- name: Upload artifact
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: ${{ env.artifactName }}
58+
path: ./output # Put the path to the build artifact files directory here.

.github/workflows/github-monitor-azure-publish.yaml

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

.github/workflows/github-monitor-build.yaml

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

0 commit comments

Comments
 (0)