diff --git a/.github/workflows/1.yaml b/.github/workflows/1.yaml
new file mode 100644
index 00000000..cd382fff
--- /dev/null
+++ b/.github/workflows/1.yaml
@@ -0,0 +1,31 @@
+name: First Workflow
+
+on:
+ workflow_dispatch:
+
+env:
+ MY_VARIABLE: "Hello from workflow"
+
+jobs:
+ job1:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set environment variable
+ run: echo "HelloJob2=Hello from job1" >> $GITHUB_ENV
+
+ - name: Echo phrase for job1
+ run: echo "This is job1"
+
+ job2:
+ runs-on: ubuntu-latest
+ needs: job1
+ steps:
+ - name: Echo phrase for job2
+ run: echo "This is job2 and MY_VARIABLE is ${{ env.MY_VARIABLE }} and HelloJob2 is ${{ env.HelloJob2 }}"
+ env:
+ JOB2_VARIABLE: ${{ env.MY_VARIABLE }}
+ - name: Cowsays
+ uses: mscoutermarsh/cowsays-action@master
+ with:
+ text: 'Ready for prod--ship it! and MY_VARIABLE is ${{ env.MY_VARIABLE }} and HelloJob2 is ${{ env.HelloJob2 }}'
+ color: 'magenta'
\ No newline at end of file
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 00000000..40a8c0ab
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,94 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL"
+
+on:
+ push:
+ branches: [ "main" ]
+ pull_request:
+ branches: [ "main" ]
+ schedule:
+ - cron: '42 3 * * 0'
+
+jobs:
+ analyze:
+ name: Analyze (${{ matrix.language }})
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
+ # - https://gh.io/supported-runners-and-hardware-resources
+ # - https://gh.io/using-larger-runners (GitHub.com only)
+ # Consider using larger runners or machines with greater resources for possible analysis time improvements.
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
+ permissions:
+ # required for all workflows
+ security-events: write
+
+ # required to fetch internal or private CodeQL packs
+ packages: read
+
+ # only required for workflows in private repositories
+ actions: read
+ contents: read
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - language: csharp
+ build-mode: none
+ - language: ruby
+ build-mode: none
+ # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
+ # Use `c-cpp` to analyze code written in C, C++ or both
+ # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
+ # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
+ # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
+ # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
+ # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
+ # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v3
+ with:
+ languages: ${{ matrix.language }}
+ build-mode: ${{ matrix.build-mode }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
+ # queries: security-extended,security-and-quality
+
+ # If the analyze step fails for one of the languages you are analyzing with
+ # "We were unable to automatically build your code", modify the matrix above
+ # to set the build mode to "manual" for that language. Then modify this step
+ # to build your code.
+ # ℹ️ Command-line programs to run using the OS shell.
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
+ - if: matrix.build-mode == 'manual'
+ shell: bash
+ run: |
+ echo 'If you are using a "manual" build mode for one or more of the' \
+ 'languages you are analyzing, replace this with the commands to build' \
+ 'your code, for example:'
+ echo ' make bootstrap'
+ echo ' make release'
+ exit 1
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v3
+ with:
+ category: "/language:${{matrix.language}}"
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
new file mode 100644
index 00000000..7b245e7a
--- /dev/null
+++ b/.github/workflows/deploy.yml
@@ -0,0 +1,35 @@
+name: Azure Bicep
+
+on:
+ workflow_dispatch
+
+env:
+ targetEnv: prod
+
+jobs:
+ build-and-deploy:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ pages: write
+ id-token: write
+ steps:
+ # Checkout code
+ - uses: actions/checkout@main
+
+ # Log into Azure
+ - uses: azure/login@v2.1.1
+ with:
+ client-id: ${{ secrets.AZURE_CLIENT_ID }}
+ tenant-id: ${{ secrets.AZURE_TENANT_ID }}
+ subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
+ enable-AzPSSession: true
+
+ # Deploy ARM template
+ - name: Run ARM deploy
+ uses: azure/arm-deploy@v1
+ with:
+ subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
+ resourceGroupName: ${{ secrets.AZURE_RG }}
+ template: ./src/InfrastructureAsCode/main.bicep
+ parameters: environment=${{ env.targetEnv }}
\ No newline at end of file
diff --git a/.github/workflows/dotnet-deploy.yml b/.github/workflows/dotnet-deploy.yml
new file mode 100644
index 00000000..a3adb07d
--- /dev/null
+++ b/.github/workflows/dotnet-deploy.yml
@@ -0,0 +1,135 @@
+name: .NET CI
+
+env:
+ registryName: 4ipc27j2pg3fkmpnpreg.azurecr.io
+ repositoryName: techexcel/dotnetcoreapp
+ dockerFolderPath: ./src/Application/src/RazorPagesTestSample
+ tag: ${{github.run_number}}
+
+on:
+ push:
+ branches: [ main ]
+ paths: src/Application/**
+ pull_request:
+ branches: [ main ]
+ paths: src/Application/**
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: 8.0
+
+ - name: Restore dependencies
+ run: dotnet restore ./src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
+ - name: Build
+ run: dotnet build --no-restore ./src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
+ - name: Test
+ run: dotnet test --no-build --verbosity normal ./src/Application/tests/RazorPagesTestSample.Tests/RazorPagesTestSample.Tests.csproj
+ - uses: actions/github-script@v6
+ if: failure()
+ with:
+ github-token: ${{secrets.GITHUB_TOKEN}}
+ script: |
+ let body = "${{ env.build_name }} Workflow Failure \n Build Number: ${{ github.run_number }} \n Build Log: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} \n SHA: [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) \n";
+ github.issues.create({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ title: "${{ env.build_name }} Workflow ${{ github.run_number }} Failed! ",
+ body: body
+ });
+
+ dockerBuildPush:
+ runs-on: ubuntu-latest
+ needs: build
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Docker Login
+ # You may pin to the exact commit or the version.
+ # uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
+ uses: docker/login-action@v1.9.0
+ with:
+ # Server address of Docker registry. If not set then will default to Docker Hub
+ registry: ${{ secrets.ACR_LOGIN_SERVER }}
+ # Username used to log against the Docker registry
+ username: ${{ secrets.ACR_USERNAME }}
+ # Password or personal access token used to log against the Docker registry
+ password: ${{ secrets.ACR_PASSWORD }}
+ # Log out from the Docker registry at the end of a job
+ logout: true
+
+ - name: Docker Build
+ run: docker build -t $registryName/$repositoryName:$tag --build-arg build_version=$tag $dockerFolderPath
+
+ - name: Docker Push
+ run: docker push $registryName/$repositoryName:$tag
+
+ deploy-to-dev:
+
+ runs-on: ubuntu-latest
+ needs: dockerBuildPush
+ environment:
+ name: dev
+ url: https://4ipc27j2pg3fk-dev.azurewebsites.net/
+
+ steps:
+ - name: 'Login via Azure CLI'
+ uses: azure/login@v2.1.1
+ with:
+ creds: ${{ secrets.AZURE_CREDENTIALS }}
+
+ - uses: azure/webapps-deploy@v2
+ with:
+ app-name: '4ipc27j2pg3fk-dev'
+ images: 4ipc27j2pg3fkmpnpreg.azurecr.io/techexcel/dotnetcoreapp:${{github.run_number}}
+
+ deploy-to-test:
+
+ runs-on: ubuntu-latest
+ needs: deploy-to-dev
+ environment:
+ name: test
+ url: https://4ipc27j2pg3fk-test.azurewebsites.net/
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: 'Login via Azure CLI'
+ uses: azure/login@v2.1.1
+ with:
+ creds: ${{ secrets.AZURE_CREDENTIALS }}
+
+ - uses: azure/webapps-deploy@v2
+ with:
+ app-name: '4ipc27j2pg3fk-test'
+ images: 4ipc27j2pg3fkmpnpreg.azurecr.io/techexcel/dotnetcoreapp:${{github.run_number}}
+
+ deploy-to-prod:
+
+ runs-on: ubuntu-latest
+ needs: deploy-to-test
+ environment:
+ name: prod
+ url: https://4ipc27j2pg3fk-prod.azurewebsites.net/
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: 'Login via Azure CLI'
+ uses: azure/login@v2.1.1
+ with:
+ creds: ${{ secrets.AZURE_CREDENTIALS }}
+
+ - uses: azure/webapps-deploy@v2
+ with:
+ app-name: '4ipc27j2pg3fk-prod'
+ images: 4ipc27j2pg3fkmpnpreg.azurecr.io/techexcel/dotnetcoreapp:${{github.run_number}}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 9bea4330..251796ae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
.DS_Store
+ src/Application/src/RazorPagesTestSample/config.json
\ No newline at end of file
diff --git a/CODEOWNERS b/CODEOWNERS
new file mode 100644
index 00000000..5c073d45
--- /dev/null
+++ b/CODEOWNERS
@@ -0,0 +1 @@
+/src/Application/ chhtw
diff --git a/Gemfile.lock b/Gemfile.lock
index f51988b9..a93526f5 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,80 +1,80 @@
-GEM
- remote: https://rubygems.org/
- specs:
- addressable (2.8.1)
- public_suffix (>= 2.0.2, < 6.0)
- colorator (1.1.0)
- concurrent-ruby (1.1.10)
- em-websocket (0.5.3)
- eventmachine (>= 0.12.9)
- http_parser.rb (~> 0)
- eventmachine (1.2.7)
- ffi (1.15.5)
- forwardable-extended (2.6.0)
- http_parser.rb (0.8.0)
- i18n (1.12.0)
- concurrent-ruby (~> 1.0)
- jekyll (4.3.0)
- addressable (~> 2.4)
- colorator (~> 1.0)
- em-websocket (~> 0.5)
- i18n (~> 1.0)
- jekyll-sass-converter (>= 2.0, < 4.0)
- jekyll-watch (~> 2.0)
- kramdown (~> 2.3, >= 2.3.1)
- kramdown-parser-gfm (~> 1.0)
- liquid (~> 4.0)
- mercenary (>= 0.3.6, < 0.5)
- pathutil (~> 0.9)
- rouge (>= 3.0, < 5.0)
- safe_yaml (~> 1.0)
- terminal-table (>= 1.8, < 4.0)
- webrick (~> 1.7)
- jekyll-sass-converter (2.2.0)
- sassc (> 2.0.1, < 3.0)
- jekyll-seo-tag (2.8.0)
- jekyll (>= 3.8, < 5.0)
- jekyll-watch (2.2.1)
- listen (~> 3.0)
- just-the-docs (0.4.2)
- jekyll (>= 3.8.5)
- jekyll-seo-tag (>= 2.0)
- rake (>= 12.3.1)
- kramdown (2.4.0)
- rexml
- kramdown-parser-gfm (1.1.0)
- kramdown (~> 2.0)
- liquid (4.0.3)
- listen (3.7.1)
- rb-fsevent (~> 0.10, >= 0.10.3)
- rb-inotify (~> 0.9, >= 0.9.10)
- mercenary (0.4.0)
- pathutil (0.16.2)
- forwardable-extended (~> 2.6)
- public_suffix (5.0.0)
- rake (13.0.6)
- rb-fsevent (0.11.2)
- rb-inotify (0.10.1)
- ffi (~> 1.0)
- rexml (3.2.8)
- strscan (>= 3.0.9)
- rouge (4.0.0)
- safe_yaml (1.0.5)
- sassc (2.4.0)
- ffi (~> 1.9)
- strscan (3.0.9)
- terminal-table (3.0.2)
- unicode-display_width (>= 1.1.1, < 3)
- unicode-display_width (2.3.0)
- webrick (1.7.0)
-
-PLATFORMS
- arm64-darwin-21
- x86_64-darwin-19
- x86_64-linux
-
-DEPENDENCIES
- jekyll (~> 4.3)
+GEM
+ remote: https://rubygems.org/
+ specs:
+ addressable (2.8.1)
+ public_suffix (>= 2.0.2, < 6.0)
+ colorator (1.1.0)
+ concurrent-ruby (1.1.10)
+ em-websocket (0.5.3)
+ eventmachine (>= 0.12.9)
+ http_parser.rb (~> 0)
+ eventmachine (1.2.7)
+ ffi (1.15.5)
+ forwardable-extended (2.6.0)
+ http_parser.rb (0.8.0)
+ i18n (1.12.0)
+ concurrent-ruby (~> 1.0)
+ jekyll (4.3.0)
+ addressable (~> 2.4)
+ colorator (~> 1.0)
+ em-websocket (~> 0.5)
+ i18n (~> 1.0)
+ jekyll-sass-converter (>= 2.0, < 4.0)
+ jekyll-watch (~> 2.0)
+ kramdown (~> 2.3, >= 2.3.1)
+ kramdown-parser-gfm (~> 1.0)
+ liquid (~> 4.0)
+ mercenary (>= 0.3.6, < 0.5)
+ pathutil (~> 0.9)
+ rouge (>= 3.0, < 5.0)
+ safe_yaml (~> 1.0)
+ terminal-table (>= 1.8, < 4.0)
+ webrick (~> 1.7)
+ jekyll-sass-converter (2.2.0)
+ sassc (> 2.0.1, < 3.0)
+ jekyll-seo-tag (2.8.0)
+ jekyll (>= 3.8, < 5.0)
+ jekyll-watch (2.2.1)
+ listen (~> 3.0)
+ just-the-docs (0.4.2)
+ jekyll (>= 3.8.5)
+ jekyll-seo-tag (>= 2.0)
+ rake (>= 12.3.1)
+ kramdown (2.4.0)
+ rexml
+ kramdown-parser-gfm (1.1.0)
+ kramdown (~> 2.0)
+ liquid (4.0.3)
+ listen (3.7.1)
+ rb-fsevent (~> 0.10, >= 0.10.3)
+ rb-inotify (~> 0.9, >= 0.9.10)
+ mercenary (0.4.0)
+ pathutil (0.16.2)
+ forwardable-extended (~> 2.6)
+ public_suffix (5.0.0)
+ rake (13.0.6)
+ rb-fsevent (0.11.2)
+ rb-inotify (0.10.1)
+ ffi (~> 1.0)
+ rexml (3.3.6)
+ strscan
+ rouge (4.0.0)
+ safe_yaml (1.0.5)
+ sassc (2.4.0)
+ ffi (~> 1.9)
+ strscan (3.1.0)
+ terminal-table (3.0.2)
+ unicode-display_width (>= 1.1.1, < 3)
+ unicode-display_width (2.3.0)
+ webrick (1.7.0)
+
+PLATFORMS
+ arm64-darwin-21
+ x86_64-darwin-19
+ x86_64-linux
+
+DEPENDENCIES
+ jekyll (~> 4.3)
just-the-docs (= 0.4.2)
BUNDLED WITH
diff --git a/src/Application/src/RazorPagesTestSample/Data/Message.cs b/src/Application/src/RazorPagesTestSample/Data/Message.cs
index ea99cbd6..69eff042 100644
--- a/src/Application/src/RazorPagesTestSample/Data/Message.cs
+++ b/src/Application/src/RazorPagesTestSample/Data/Message.cs
@@ -7,9 +7,15 @@ public class Message
{
public int Id { get; set; }
- [Required]
+ ///