Skip to content

Perffix #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c0dbcd2
removed pages.yaml
ahmedsza Oct 29, 2024
0bb1f99
commit workflow
ahmedsza Oct 29, 2024
86727d2
removed build step, fixed the cowsway
ahmedsza Oct 29, 2024
ebe5f6f
fix action
ahmedsza Oct 29, 2024
c092ae8
setup dependancy
ahmedsza Oct 29, 2024
f172d5b
trigger on issue opened
ahmedsza Oct 29, 2024
7f50528
Refactor message entity to include text length validation. resolves #7
ahmedsza Oct 29, 2024
35ce2ca
Merge pull request #8 from ahmedsza/7-support-250-characters-for-mess…
ahmedsza Oct 29, 2024
95d1560
bicep code
ahmedsza Oct 29, 2024
9dd6d5f
Merge branch 'main' of https://github.com/ahmedsza/TechExcel-Accelera…
ahmedsza Oct 29, 2024
7b9b6d6
deploy yaml
ahmedsza Oct 29, 2024
6ec4729
Refactor deploy.yml to remove unused federated token
ahmedsza Oct 29, 2024
bed8d16
Refactor deploy.yml to update permissions
ahmedsza Oct 29, 2024
43520d4
Refactor deploy.yml to update template file path
ahmedsza Oct 29, 2024
a2f589d
Refactor deploy.yml to update template file path, permissions, and re…
ahmedsza Oct 29, 2024
aa4e0df
Refactor deploy.yml to update template file path, permissions, and re…
ahmedsza Oct 29, 2024
1a5f008
Create dotnet.yml
ahmedsza Oct 30, 2024
76eea4d
Refactor dotnet.yml to include specific paths for push and pull_reque…
ahmedsza Oct 30, 2024
0ed3c39
Refactor dotnet.yml to include specific paths for push and pull_reque…
ahmedsza Oct 30, 2024
45e4310
Refactor dotnet.yml to include specific paths for push and pull_reque…
ahmedsza Oct 30, 2024
704e8c3
Refactor dotnet.yml to include specific paths for push and pull_reque…
ahmedsza Oct 30, 2024
96949df
Refactor dotnet.yml to include specific paths for push and pull_reque…
ahmedsza Oct 30, 2024
dfee373
Refactor dotnet.yml to include specific paths for push and pull_reque…
ahmedsza Oct 30, 2024
4be1e38
Refactor dotnet.yml to include specific paths for push and pull_reque…
ahmedsza Oct 30, 2024
e21d437
Refactor dotnet.yml to include specific paths for push and pull_reque…
ahmedsza Oct 30, 2024
78671f4
Refactor dotnet.yml to include specific paths for push and pull_reque…
ahmedsza Oct 30, 2024
ac714f2
Refactor dotnet.yml to update Azure Login action to use version 2
ahmedsza Oct 30, 2024
a05aa30
Refactor dotnet.yml to update Azure Login action to use version 2 and…
ahmedsza Oct 30, 2024
c32da31
Refactor dotnet.yml to update Azure Login action to use version 2 and…
ahmedsza Oct 30, 2024
85723ad
Refactor dotnet.yml to remove deployment to Azure Web App and update …
ahmedsza Oct 30, 2024
de6cb96
Refactor dotnet.yml to include dependency on 'buildacr' job
ahmedsza Oct 30, 2024
20ced96
Add CODEOWNERS file with default code owner
ahmedsza Oct 30, 2024
3a2d59c
Update title in Index.cshtml to include PR for Munson's Pickles and P…
ahmedsza Oct 30, 2024
6bbb978
Merge pull request #9 from ahmedsza/featuretestex4
ahmedsza Oct 30, 2024
a72f17d
Add security policy to SECURITY.md
ahmedsza Oct 30, 2024
90e1970
Merge pull request #10 from ahmedsza/securitybranch
ahmedsza Oct 30, 2024
7369364
Create codeql.yml
ahmedsza Oct 30, 2024
7426c11
Merge pull request #11 from ahmedsza/ahmedsza-patch-1
ahmedsza Oct 30, 2024
58b46ac
Refactor performance loop in Index.cshtml.cs
ahmedsza Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -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 Advanced"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '38 1 * * 5'

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}}"
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy Azure Resources

on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to'
required: true
default: 'dev'

permissions:
id-token: write
contents: read

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Azure CLI
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: true

- name: Set deployment name
id: set-deployment-name
run: echo "##[set-output name=deployment_name;]deployment-$(date +%s)"

- name: Deploy Bicep file
run: |
az deployment group create \
--resource-group ${{ secrets.AZURE_RG }} \
--name ${{ steps.set-deployment-name.outputs.deployment_name }} \
--template-file src/InfrastructureAsCode/main.bicep \
--parameters environment=${{ github.event.inputs.environment }}

- name: Output results
run: |
echo "App Service Name: $(az deployment group show --resource-group ${{ secrets.AZURE_RG }} --name ${{ steps.set-deployment-name.outputs.deployment_name }} --query properties.outputs.appServiceName.value -o tsv)"
echo "App Service URL: $(az deployment group show --resource-group ${{ secrets.AZURE_RG }} --name ${{ steps.set-deployment-name.outputs.deployment_name }} --query properties.outputs.appServiceUrl.value -o tsv)"
echo "Container Registry Name: $(az deployment group show --resource-group ${{ secrets.AZURE_RG }} --name ${{ steps.set-deployment-name.outputs.deployment_name }} --query properties.outputs.containerRegistryName.value -o tsv)"
130 changes: 130 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET

on:
push:
branches: [ "main" ]
paths:
- 'src/Application/**'
pull_request:
branches: [ "main" ]
paths:
- 'src/Application/**'
workflow_dispatch:


permissions:
id-token: write
contents: read

env:
registryName: "q3zpru2gmy754mpnpreg.azurecr.io" # Replace registryName with the name of your registry
repositoryName: "techexcel/dotnetcoreapp"
dockerFolderPath: "src/Application/src/RazorPagesTestSample"
tag: ${{ github.run_number }}

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
- name: Build
run: dotnet build src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj --no-restore
- name: Test
run: dotnet test src/Application/tests/RazorPagesTestSample.Tests/RazorPagesTestSample.Tests.csproj --no-build --verbosity normal

buildacr:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4

- name: Login to Azure Container Registry
run: echo "${{ secrets.ACR_PASSWORD }}" | docker login ${{ env.registryName }} -u ${{ secrets.ACR_USERNAME }} --password-stdin

- name: Build and push Docker image
run: |
docker build ${{ env.dockerFolderPath }} -t ${{ env.registryName }}/${{ env.repositoryName }}:${{ env.tag }}
docker push ${{ env.registryName }}/${{ env.repositoryName }}:${{ env.tag }}

deploytodev:
runs-on: ubuntu-latest
needs: buildacr
environment: dev

steps:
- uses: actions/checkout@v4

- name: Azure Login
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}


- name: Deploy to Azure Web App
run: |
az webapp config container set \
--name q3zpru2gmy754-dev \
--resource-group ${{ secrets.AZURE_RG }} \
--docker-custom-image-name ${{ env.registryName }}/${{ env.repositoryName }}:${{ env.tag }} \
--docker-registry-server-url https://${{ env.registryName }} \
--docker-registry-server-user ${{ secrets.ACR_USERNAME }} \
--docker-registry-server-password ${{ secrets.ACR_PASSWORD }}


deploytotest:
runs-on: ubuntu-latest
needs: deploytodev
environment: test

steps:
- uses: actions/checkout@v4

- name: Azure Login
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}


- name: Deploy to Azure Web App
run: |
az webapp config container set \
--name q3zpru2gmy754-test \
--resource-group ${{ secrets.AZURE_RG }} \
--docker-custom-image-name ${{ env.registryName }}/${{ env.repositoryName }}:${{ env.tag }} \
--docker-registry-server-url https://${{ env.registryName }} \
--docker-registry-server-user ${{ secrets.ACR_USERNAME }} \
--docker-registry-server-password ${{ secrets.ACR_PASSWORD }}

deploytoprod:
runs-on: ubuntu-latest
needs: deploytotest
environment: prod

steps:
- uses: actions/checkout@v4

- name: Azure Login
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}


- name: Deploy to Azure Web App
run: |
az webapp config container set \
--name q3zpru2gmy754-prod \
--resource-group ${{ secrets.AZURE_RG }} \
--docker-custom-image-name ${{ env.registryName }}/${{ env.repositoryName }}:${{ env.tag }} \
--docker-registry-server-url https://${{ env.registryName }} \
--docker-registry-server-user ${{ secrets.ACR_USERNAME }} \
--docker-registry-server-password ${{ secrets.ACR_PASSWORD }}
29 changes: 29 additions & 0 deletions .github/workflows/first-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Manual Trigger Workflow

on:
workflow_dispatch:
issues:
types: [opened]

jobs:

job1:
runs-on: ubuntu-latest

steps:
- name: Step 1
run: echo "Step 1 complete!"

- name: Step 2
run: echo "Step 2 complete!"

job2:
needs: job1
runs-on: ubuntu-latest

steps:
- name: Cowsays Action
uses: mscoutermarsh/cowsays-action@master
with:
text: "Ready for prod–ship it!"
color: magenta
62 changes: 0 additions & 62 deletions .github/workflows/pages.yml

This file was deleted.

Loading
Loading