Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
300 commits
Select commit Hold shift + click to select a range
c5c4f6e
Target right file for secrets. Replace in deployment
RobertLynJA Nov 5, 2022
0268372
Add secret replacement for prod deployment
RobertLynJA Nov 5, 2022
0e96f89
Merge pull request #18 from RobertLynJA/SetupDBConnections
RobertLynJA Nov 5, 2022
de30672
Setup project startup. Create DB
RobertLynJA Nov 5, 2022
dd7698f
Merge pull request #19 from RobertLynJA/SetupEF
RobertLynJA Nov 5, 2022
f48f10f
Bump loader-utils from 2.0.2 to 2.0.3 in /web
dependabot[bot] Nov 9, 2022
b673ac2
Update Nuget packages, switched to xUnit
RobertLynJA Nov 9, 2022
e01aedf
Merge pull request #20 from RobertLynJA/dependabot/npm_and_yarn/web/l…
RobertLynJA Nov 9, 2022
0f69b57
Fix API.Tests casing
RobertLynJA Nov 9, 2022
55f01ec
Merge branch 'main' into UpdateNuget
RobertLynJA Nov 9, 2022
0ced257
Merge pull request #21 from RobertLynJA/UpdateNuget
RobertLynJA Nov 9, 2022
bab8f86
Allow deployment artifacts to run on linux (#22)
RobertLynJA Nov 9, 2022
a1c8c01
Fix production deployment going to dev server
RobertLynJA Nov 9, 2022
40ff111
Merge pull request #24 from RobertLynJA/RobertLynJA-patch-2
RobertLynJA Nov 9, 2022
520264f
Fix pulling dev secrets for prod
RobertLynJA Nov 9, 2022
18a86b5
Merge pull request #26 from RobertLynJA/RobertLynJA-patch-1
RobertLynJA Nov 9, 2022
8a1314d
Merge pull request #25 from RobertLynJA/release-0.0.2
RobertLynJA Nov 9, 2022
622864f
Improve deployment scripts (#28)
RobertLynJA Nov 14, 2022
fbd0da0
Cache node modules (#30)
RobertLynJA Nov 14, 2022
034f2f6
Set powershell as shell for deploy
RobertLynJA Nov 14, 2022
37b38c3
Run builds only on pull request
RobertLynJA Nov 14, 2022
70452c2
Set default shell for deploy
RobertLynJA Nov 14, 2022
ec8d635
Merge pull request #32 from RobertLynJA/RobertLynJA-patch-1
RobertLynJA Nov 14, 2022
4814a01
Set offline page to refresh in 30 seconds (#33)
RobertLynJA Nov 14, 2022
18d5c6b
Increase wait time before deleting files to avoid locks (#34)
RobertLynJA Nov 15, 2022
13f5caf
Upgrade to .Net 7
RobertLynJA Nov 15, 2022
8dc9d2d
Update Nuget packages
RobertLynJA Nov 15, 2022
77290a4
Merge pull request #36 from RobertLynJA/Net7
RobertLynJA Nov 15, 2022
a4e9d8d
Update variable substitution to node16
RobertLynJA Nov 15, 2022
7cabacb
Bump loader-utils from 2.0.3 to 2.0.4 in /web
dependabot[bot] Nov 16, 2022
a929218
Bump minimatch and recursive-readdir in /web (#27)
dependabot[bot] Nov 16, 2022
6bb17be
Merge branch 'main' into dependabot/npm_and_yarn/web/loader-utils-2.0.4
RobertLynJA Nov 16, 2022
19ba297
Merge pull request #38 from RobertLynJA/dependabot/npm_and_yarn/web/l…
RobertLynJA Nov 16, 2022
e24915f
Update version for Variable Substitution (#39)
RobertLynJA Nov 16, 2022
6bf80db
Update README.md (#40)
RobertLynJA Nov 16, 2022
54639e5
Updated variable substitution version in Prod (#41)
RobertLynJA Nov 16, 2022
8b36d94
Update React and dependencies (#42)
RobertLynJA Nov 22, 2022
e864393
Set URL for prod build, move prod to main branch (#43)
RobertLynJA Nov 23, 2022
18a3f23
Deploy to azure app service (#44)
RobertLynJA Nov 23, 2022
2725b79
Change variable substitution version in azure deployment (#45)
RobertLynJA Nov 23, 2022
18e510e
Move ReactScripts to devDependencies to avoid incorrect security warn…
RobertLynJA Nov 25, 2022
29a8ffc
Update variable-substitution version
RobertLynJA Nov 28, 2022
478bd98
Update variable-substitution version
RobertLynJA Nov 28, 2022
3a40414
Update variable-substitution version
RobertLynJA Nov 28, 2022
4a6e74c
Remove production VM deployment
RobertLynJA Dec 3, 2022
6e43e7d
Replace production deployment with azure app service
RobertLynJA Dec 3, 2022
1ddcb33
Cache npm packages (#50)
RobertLynJA Dec 3, 2022
158d6c4
Rename cache nuget step (#51)
RobertLynJA Dec 3, 2022
ed78c5d
Add Google analytics (#52)
RobertLynJA Dec 7, 2022
a1830c2
Update node packages (#53)
RobertLynJA Dec 7, 2022
27b0ae5
Merge build and deploy to single file (#54)
RobertLynJA Dec 14, 2022
e1d924d
Add application insights nuget package (#55)
RobertLynJA Dec 14, 2022
e8ba922
Update Webapps-deploy version (#56)
RobertLynJA Dec 14, 2022
f8a00d9
Add dependabot support (#57)
RobertLynJA Dec 14, 2022
acb7a9b
Bump typescript from 4.9.3 to 4.9.4 in /web
dependabot[bot] Dec 14, 2022
d6434cb
Bump @types/node from 18.11.11 to 18.11.15 in /web
dependabot[bot] Dec 14, 2022
9fd6d07
Add dependabot to nuget
RobertLynJA Dec 14, 2022
7b7a71d
Move react to static web app (#61)
RobertLynJA Dec 15, 2022
c29ddfb
Add Dependabot scans to actions
RobertLynJA Dec 15, 2022
8beb6dc
Add job to cleanup workflow logs
RobertLynJA Dec 19, 2022
c95dff4
Add token to cleanup job
RobertLynJA Dec 19, 2022
6248b28
Use cache dependency in setup-node
RobertLynJA Dec 19, 2022
f778ce7
Allow Dependabot to scan all yml files
RobertLynJA Dec 19, 2022
15a2387
Bump actions/setup-dotnet from 2 to 3
dependabot[bot] Dec 19, 2022
2ce9e05
Bump Microsoft.NET.Test.Sdk from 17.4.0 to 17.4.1 in /API.Tests
dependabot[bot] Dec 20, 2022
5de3b00
Bump @types/node from 18.11.15 to 18.11.17 in /web
dependabot[bot] Dec 20, 2022
7034c2b
Bump Microsoft.NET.Test.Sdk from 17.4.0 to 17.4.1 in /DataFacade.Tests
dependabot[bot] Dec 20, 2022
7934a6b
Added API at / to prevent 404 errors from Azure Always On
RobertLynJA Dec 21, 2022
aa2bcfc
Fix test, change controller to return actionresult (#72)
RobertLynJA Dec 22, 2022
878d05e
Remove WeatherForecast template controller
RobertLynJA Dec 22, 2022
9ea8a5c
Rename Story's Publish to PublishDate
RobertLynJA Dec 22, 2022
ae337d6
Remove ActionResult since only 1 return type possible
RobertLynJA Dec 22, 2022
b15671c
Add StoriesController
RobertLynJA Dec 22, 2022
5562544
Add Tailwind CSS
RobertLynJA Dec 23, 2022
356832a
Remove EFCore from API
RobertLynJA Dec 23, 2022
3fcab9e
Upload .Net test results
RobertLynJA Dec 23, 2022
eb6ec98
Update esproj javascript version
RobertLynJA Dec 23, 2022
e60f576
Change dotnet test to target entire solution
RobertLynJA Dec 23, 2022
6476c5c
Move .Net build to Win to prevent error MSB3644
RobertLynJA Dec 23, 2022
f38c353
Fix .Net test results name
RobertLynJA Dec 23, 2022
21a81fb
Set .Net build to linux
RobertLynJA Dec 23, 2022
3918368
Bump @types/node from 18.11.17 to 18.11.18 in /web
dependabot[bot] Dec 26, 2022
9096e3d
Bump @types/react-dom from 18.0.9 to 18.0.10 in /web
dependabot[bot] Dec 26, 2022
ef3caf7
Replace react project with next
RobertLynJA Dec 27, 2022
71bae18
Update build for next
RobertLynJA Dec 27, 2022
e3373ed
Remove unused workflows
RobertLynJA Dec 27, 2022
dbf2ae9
Replace react project with next
RobertLynJA Dec 27, 2022
317ea0a
Update build for next
RobertLynJA Dec 27, 2022
a52d696
Remove unused workflows
RobertLynJA Dec 27, 2022
0ed1dd2
Switch to standalone build
RobertLynJA Dec 27, 2022
e04f3eb
Tidy up workflow names
RobertLynJA Dec 27, 2022
680aa75
Fix next app service name
RobertLynJA Dec 27, 2022
fdeda93
Bump babel-jest from 28.1.0 to 29.3.1 in /web
dependabot[bot] Dec 27, 2022
ae0c711
Bump @testing-library/jest-dom from 5.16.4 to 5.16.5 in /web
dependabot[bot] Dec 27, 2022
852bbf0
Bump jest from 28.1.0 to 29.3.1 in /web
dependabot[bot] Dec 27, 2022
548cc1a
Bump @testing-library/react from 13.2.0 to 13.4.0 in /web
dependabot[bot] Dec 27, 2022
65a6e9e
Bump @testing-library/user-event from 14.2.0 to 14.4.3 in /web
dependabot[bot] Dec 27, 2022
b040c93
Add Tailwind library
RobertLynJA Dec 27, 2022
6dbd292
Fix index test
RobertLynJA Dec 27, 2022
b3aaebf
Add axios
RobertLynJA Dec 27, 2022
faec677
Make test service call to API
RobertLynJA Dec 27, 2022
9c961d3
Change API endpoint to bypass Cloudflare issues
RobertLynJA Dec 27, 2022
c5f232c
Change page title
RobertLynJA Dec 27, 2022
119ca2a
Remove WeatherForecast template controller
RobertLynJA Dec 22, 2022
8f10224
Rename Story's Publish to PublishDate
RobertLynJA Dec 22, 2022
a7de007
Remove ActionResult since only 1 return type possible
RobertLynJA Dec 22, 2022
7df0b8a
Add StoriesController
RobertLynJA Dec 22, 2022
a78db37
Remove EFCore from API
RobertLynJA Dec 23, 2022
6535704
Add story data sorce interface
RobertLynJA Dec 28, 2022
9c85f68
Call dummy controller action and show results
RobertLynJA Dec 28, 2022
c94771d
Fix merge conflict
RobertLynJA Dec 28, 2022
199d3d2
Merge pull request #90 from RobertLynJA/CreateStoriesController
RobertLynJA Dec 28, 2022
7eff84f
Use getInitialProps and use correct NextPage type
RobertLynJA Dec 28, 2022
fba1281
Add cookie consent popup
RobertLynJA Dec 29, 2022
2c55250
Update README.md
RobertLynJA Dec 29, 2022
a80ea1c
Create a layout component, moved cookie consent into layout
RobertLynJA Dec 30, 2022
8706814
Make API url available to the client
RobertLynJA Dec 31, 2022
f7fa093
Add ErrorLogger class
RobertLynJA Dec 31, 2022
eb76ad2
Add Stories api class
RobertLynJA Dec 31, 2022
c9030fb
Move Layout into UI folder
RobertLynJA Dec 31, 2022
3a2b93c
Add file for default values
RobertLynJA Dec 31, 2022
4493a19
Migrate api call out of index
RobertLynJA Dec 31, 2022
9bb5660
Only deploy if both projects build
RobertLynJA Dec 31, 2022
8896038
Switch logging of errors to error stream
RobertLynJA Dec 31, 2022
33fdd66
Add more caching to improve build time
RobertLynJA Dec 31, 2022
099ac92
Revert dotnet publish command (error)
RobertLynJA Dec 31, 2022
2f33ac3
Change build dependencies again (got reverted)
RobertLynJA Dec 31, 2022
ca89c15
Add Url to error logging
RobertLynJA Dec 31, 2022
80a06e2
Add stacktrace to error log
RobertLynJA Dec 31, 2022
a34e999
Remove latest for next dependency
RobertLynJA Jan 1, 2023
d9063b4
Bump typescript from 4.6.4 to 4.9.4 in /web
dependabot[bot] Jan 1, 2023
91b9bca
Bump axios from 1.2.1 to 1.2.2 in /web
dependabot[bot] Jan 1, 2023
584a032
Bump jest-environment-jsdom from 28.1.0 to 29.3.1 in /web
dependabot[bot] Jan 1, 2023
afc8f90
Bump @types/react from 18.0.9 to 18.0.26 in /web
dependabot[bot] Jan 1, 2023
33288a8
Send api through Cloudflare since axios was fixed
RobertLynJA Jan 1, 2023
dec1272
Add response caching to api
RobertLynJA Jan 1, 2023
7d92510
Remove conn string step, use AppService setting
RobertLynJA Jan 2, 2023
174f2dc
Remove EFCore, add CosmosDB
RobertLynJA Jan 6, 2023
653d94f
Query stories from cosmos
RobertLynJA Jan 6, 2023
a3cec24
Add connection pooling for Cosmos
RobertLynJA Jan 6, 2023
91c90af
Separate API and DB models
RobertLynJA Jan 7, 2023
dc97150
Return API Model
RobertLynJA Jan 7, 2023
6dd1ab0
Bump postcss from 8.4.20 to 8.4.21 in /web
dependabot[bot] Jan 9, 2023
385cf20
Return Readonly lists
RobertLynJA Jan 8, 2023
7041012
Add page for single story
RobertLynJA Jan 16, 2023
e66421a
Handle 404
RobertLynJA Jan 16, 2023
1b3b9d2
Remove incorrect semicolon in style
RobertLynJA Jan 16, 2023
7f2a7fb
Bump Swashbuckle.AspNetCore from 6.4.0 to 6.5.0 in /API
dependabot[bot] Jan 16, 2023
050c4bd
Bump next from 13.1.1 to 13.1.2 in /web
dependabot[bot] Jan 16, 2023
903cb7b
Render story content using markdown
RobertLynJA Jan 17, 2023
2fbef7b
Fix jest error for react markdown
RobertLynJA Jan 17, 2023
cf7043b
Handle different story encodings, style links in story
RobertLynJA Jan 17, 2023
9a61535
Update README.md
RobertLynJA Jan 17, 2023
f0a176f
Added some styling using font weight and padding.
RobertLynJA Jan 18, 2023
4e076af
Added some styling using font weight and padding.
RobertLynJA Jan 18, 2023
d8d02cd
Implement MediatR in DataFacade
RobertLynJA Jan 23, 2023
d96d0d0
Add unit tests for command handlers
RobertLynJA Jan 23, 2023
5b8fdc9
Update cache version
RobertLynJA Jan 23, 2023
6f27288
Bump @types/react from 18.0.26 to 18.0.27 in /web
dependabot[bot] Jan 23, 2023
1d4273f
Add html lang tag
RobertLynJA Jan 25, 2023
474223a
Bump next from 13.1.5 to 13.1.6 in /web
dependabot[bot] Jan 30, 2023
c5e0464
Create robots.txt
RobertLynJA Feb 4, 2023
e70fc6d
Add background color to body
RobertLynJA Feb 4, 2023
6e439f4
Remove background color from main div
RobertLynJA Feb 4, 2023
2ef8f54
Add Auth0 login to web
RobertLynJA Feb 1, 2023
6374c51
Add Auth0 to API
RobertLynJA Feb 1, 2023
14fd330
Add call to protected API
RobertLynJA Feb 3, 2023
1def356
Use new namespace declaration
RobertLynJA Feb 5, 2023
fdacd3d
Add RestSharp package
RobertLynJA Feb 5, 2023
9e697f8
Rename Auth0 settings. Configure RestClient in DI
RobertLynJA Feb 5, 2023
d2f17f9
Add classes for Options pattern
RobertLynJA Feb 5, 2023
e41c47a
Add Auth0 config to appsettings
RobertLynJA Feb 5, 2023
c28a978
Add Auth0 API classes
RobertLynJA Feb 5, 2023
78689b0
Add class to get user info from Auth0
RobertLynJA Feb 5, 2023
392a69b
Remove Startup.cs
RobertLynJA Feb 5, 2023
e00d6df
Setup configurations for DI
RobertLynJA Feb 5, 2023
4c79fee
Fix config keys
RobertLynJA Feb 5, 2023
5f4f449
Make calls to protected API
RobertLynJA Feb 5, 2023
c011af1
Fix null check
RobertLynJA Feb 5, 2023
2c467c9
Fix undefined classNames
RobertLynJA Feb 6, 2023
8bbbbcf
Bump axios from 1.2.6 to 1.3.2 in /web
dependabot[bot] Feb 6, 2023
c23a8a8
Move .Net version to env variable
RobertLynJA Feb 14, 2023
c94de76
Bump @types/react from 18.0.27 to 18.0.28 in /web
dependabot[bot] Feb 14, 2023
953ce04
Change Dependabot to monthly updates
RobertLynJA Feb 21, 2023
95ec6af
Delete codeql.yml
RobertLynJA Feb 21, 2023
0bca3a2
Update dependencies
dependabot[bot] Feb 21, 2023
e6b1295
Bump next from 13.4.4 to 13.4.7 in /web
dependabot[bot] Jul 1, 2023
147dff2
Bump @types/react from 18.2.8 to 18.2.14 in /web
dependabot[bot] Jul 7, 2023
a51d9dd
Bump @types/auth0 from 3.3.2 to 3.3.3 in /web
dependabot[bot] Jul 7, 2023
83674e2
Bump typescript from 5.1.3 to 5.1.6 in /web
dependabot[bot] Jul 7, 2023
3d70af0
Bump swr from 2.1.5 to 2.2.0 in /web
dependabot[bot] Jul 7, 2023
20121d2
Bump tough-cookie from 4.1.2 to 4.1.3 in /web
dependabot[bot] Jul 7, 2023
5320ae1
Update nuget packages
RobertLynJA Jul 9, 2023
1b6a70c
Bump word-wrap from 1.2.3 to 1.2.4 in /web
dependabot[bot] Jul 19, 2023
dadd016
Update build to deploy docker containers
RobertLynJA Aug 1, 2023
93f4fac
Update .Net packages
RobertLynJA Aug 2, 2023
1e99512
Update cleanLogs.yml
RobertLynJA Aug 2, 2023
19d44d3
Remove package cleanup from cleanlogs
RobertLynJA Aug 2, 2023
9469374
Add package cleanup job
RobertLynJA Aug 2, 2023
ef574e3
Fix clean package job name
RobertLynJA Aug 2, 2023
fdcc637
Fix container names in cleanPackages
RobertLynJA Aug 2, 2023
dc90594
Bump tailwindcss from 3.3.2 to 3.3.3 in /web
dependabot[bot] Aug 2, 2023
f1a3080
Add permissions to build file
RobertLynJA Aug 2, 2023
3e69358
Bump postcss from 8.4.24 to 8.4.27 in /web
dependabot[bot] Aug 2, 2023
b9116bd
Bump @types/react from 18.2.14 to 18.2.18 in /web
dependabot[bot] Aug 2, 2023
5aa14ac
Replace Moq with NSubstitute
RobertLynJA Aug 9, 2023
b689704
Remove outdated comments
RobertLynJA Aug 9, 2023
ab1face
Use alpine image for .Net
RobertLynJA Aug 20, 2023
5cd522b
Only publish package on deployment
RobertLynJA Aug 20, 2023
b820b5d
Update nuget packages
RobertLynJA Sep 1, 2023
8a45259
Bump azure/webapps-deploy from 2.2.9 to 2.2.11
dependabot[bot] Sep 1, 2023
cbf0571
Bump babel-jest from 29.5.0 to 29.6.4 in /web
dependabot[bot] Sep 2, 2023
5bfa1f6
Bump autoprefixer from 10.4.14 to 10.4.15 in /web
dependabot[bot] Sep 2, 2023
6fd6a58
Bump @types/react from 18.2.18 to 18.2.21 in /web
dependabot[bot] Sep 2, 2023
3f1bc75
Update .Net dependencies
RobertLynJA Oct 2, 2023
c977cf5
Bump actions/checkout from 3 to 4
dependabot[bot] Oct 2, 2023
59f8b72
Bump docker/login-action from 2 to 3
dependabot[bot] Oct 2, 2023
071c4b7
Bump docker/setup-buildx-action from 2 to 3
dependabot[bot] Oct 2, 2023
4e691b5
Bump docker/build-push-action from 4 to 5
dependabot[bot] Oct 2, 2023
1e2eb8b
Bump axios from 1.4.0 to 1.5.1 in /web
dependabot[bot] Oct 2, 2023
8bd5d5e
Update Nuget packages
RobertLynJA Oct 31, 2023
53534e3
Update Nuget packages
RobertLynJA Nov 11, 2023
ebea06f
Update .Net to version 8
RobertLynJA Nov 14, 2023
8d7340e
Change expose port to .Net 8 default
RobertLynJA Nov 14, 2023
824c035
Update cleanPackages.yml
RobertLynJA Nov 18, 2023
37314c9
Bump azure/webapps-deploy from 2.2.11 to 3.0.0
dependabot[bot] Nov 18, 2023
024b3fd
Change cleanPackages to run weekly
RobertLynJA Nov 18, 2023
a2a9f85
Update Node to v20
RobertLynJA Nov 21, 2023
40b2a6c
Add weekly build to update base containers
RobertLynJA Nov 28, 2023
628862d
Bump igorjs/gh-actions-clean-workflow from 3 to 4
dependabot[bot] Nov 28, 2023
e5b5858
Deploy on schedule build
RobertLynJA Dec 4, 2023
4d349d9
Update nuget packages
RobertLynJA Feb 21, 2024
f806003
Bump actions/delete-package-versions from 4 to 5
dependabot[bot] Mar 1, 2024
4195070
Rename folder case
RobertLynJA Mar 28, 2024
bfbc9bc
Run .Net tests
RobertLynJA Mar 28, 2024
3617e80
Update nuget packages
RobertLynJA Apr 2, 2024
3b73e2f
Switch off deprecated Automapper
RobertLynJA Apr 2, 2024
1325a4b
Update Nuget packages
dependabot[bot] Apr 8, 2024
b49e224
Bump igorjs/gh-actions-clean-workflow from 5 to 6
dependabot[bot] Jul 1, 2024
081ba99
Change from deprecated days_old parameter
RobertLynJA Jul 6, 2024
b1652cb
Bump docker/build-push-action from 5 to 6
dependabot[bot] Jul 6, 2024
d03c882
Update Nuget packages
RobertLynJA Jul 6, 2024
ab79e21
Enable code style in build, fix code issues
RobertLynJA Jul 6, 2024
7d9879f
Update Nuget packages
RobertLynJA Sep 1, 2024
2046e9c
Bump azure/webapps-deploy from 3.0.1 to 3.0.2
dependabot[bot] Sep 1, 2024
a20728c
Add data types to controller return types.
RobertLynJA Nov 1, 2024
cacf694
Change Docker file to remove legacy ENV assignment
RobertLynJA Nov 1, 2024
c68422a
Remove AutoMapper dependency
RobertLynJA Nov 5, 2024
26ea6f0
Update nuget packages
RobertLynJA Nov 5, 2024
76353cf
Bump typescript from 5.1.6 to 5.7.3 in /web
dependabot[bot] Feb 1, 2025
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
31 changes: 31 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/web/" # Location of package manifests
schedule:
interval: "monthly"
- package-ecosystem: "nuget" # See documentation for possible values
directory: "/API/" # Location of package manifests
schedule:
interval: "monthly"
- package-ecosystem: "nuget" # See documentation for possible values
directory: "/API.Tests/" # Location of package manifests
schedule:
interval: "monthly"
- package-ecosystem: "nuget" # See documentation for possible values
directory: "/DataFacade/" # Location of package manifests
schedule:
interval: "monthly"
- package-ecosystem: "nuget" # See documentation for possible values
directory: "/DataFacade.Tests/" # Location of package manifests
schedule:
interval: "monthly"
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
124 changes: 124 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Build
#concurrency: deploy

on:
push:
branches:
- "main"
- "release"
pull_request:
branches:
- "main"
schedule:
- cron: "0 4 * * 0"

env:
AZURE_NEXTJS_WEBAPP_NAME: 'RobertLynJANext'
AZURE_WEBAPP_PACKAGE_PATH: './'
WEB_WORKING_DIRECTORY: './web'
AZURE_API_WEBAPP_NAME: 'RobertLynJAApi'
DEPLOY: ${{ github.event_name == 'push' }}

jobs:

build-web:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Lowercase the repo name
run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}

- name: Build and push container image to registry
uses: docker/build-push-action@v6
with:
push: ${{ env.DEPLOY }}
tags: ghcr.io/${{ env.REPO }}-web:${{ github.sha }}
file: ./web/Dockerfile

deploy-web:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
needs: [build-web, build-api]

environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Lowercase the repo name
run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}

- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@2fdd5c3ebb4e540834e86ecc1f6fdcd5539023ee
with:
app-name: ${{ env.AZURE_NEXTJS_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_NEXTJS_PUBLISH_PROFILE_D }}
images: 'ghcr.io/${{ env.REPO }}-web:${{ github.sha }}'

build-api:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Lowercase the repo name
run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}

- name: Build and push container image to registry
uses: docker/build-push-action@v6
with:
push: ${{ env.DEPLOY }}
tags: ghcr.io/${{ env.REPO }}-api:${{ github.sha }}
file: ./API/Dockerfile

deploy-api:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
needs: [build-web, build-api]

environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Lowercase the repo name
run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}

- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@2fdd5c3ebb4e540834e86ecc1f6fdcd5539023ee
with:
app-name: ${{ env.AZURE_API_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_API_PUBLISH_PROFILE_D }}
images: 'ghcr.io/${{ env.REPO }}-api:${{ github.sha }}'
15 changes: 15 additions & 0 deletions .github/workflows/cleanLogs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Clean Workflow Logs

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 1" # Runs "At 00:00 on Monday." (see https://crontab.guru)

jobs:
clean-logs:
runs-on: ubuntu-latest
steps:
- uses: igorjs/gh-actions-clean-workflow@v6
with:
runs_older_than: "14" # optional, default value: "7"
token: ${{ github.token }}
21 changes: 21 additions & 0 deletions .github/workflows/cleanPackages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Clean Packages

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 1" # Runs "At 00:00 on Monday." (see https://crontab.guru)

jobs:
clean-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/delete-package-versions@v5
with:
package-name: 'blog2-api'
package-type: 'container'
min-versions-to-keep: 10
- uses: actions/delete-package-versions@v5
with:
package-name: 'blog2-web'
package-type: 'container'
min-versions-to-keep: 10
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,5 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd
/API/appsettings.Local.json
35 changes: 35 additions & 0 deletions API.Tests/API.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Castle.Core" Version="5.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.17">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\API\API.csproj" />
</ItemGroup>

</Project>
34 changes: 34 additions & 0 deletions API.Tests/Controllers/SiteControllerTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using API.Controllers;
using API.Tests.TestExtensions;
using Castle.Core.Logging;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using NSubstitute.Core.Arguments;

namespace Api.Tests.Controllers;

public class SiteControllerTests
{
[Fact]
public void SiteController_Get_ReturnsText()
{
//Arrange
var logger = Substitute.For<ILogger<SiteController>>();
var controller = new SiteController(logger)
{
ControllerContext = new ControllerContext()
{
HttpContext = new DefaultHttpContext()
}
};

//Act
var contentResult = controller.GetHelloMessage();

// Assert
Assert.NotNull(contentResult);
Assert.Equal("Hello, I'm working :)", contentResult);
logger.Received().AnyLogOfType(LogLevel.Information);
}
}
12 changes: 12 additions & 0 deletions API.Tests/Controllers/StoriesControllerTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using API.Controllers;
using Microsoft.AspNetCore.Mvc;

namespace Api.Tests.Controllers;

public class StoriesControllerTests
{
[Fact]
public void Test1()
{
}
}
17 changes: 17 additions & 0 deletions API.Tests/TestExtensions/ILoggerExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace API.Tests.TestExtensions;

public static class ILoggerExtensions
{
public static void AnyLogOfType<T>(this ILogger<T> logger, LogLevel level) where T : class
{
logger.Log(level, Arg.Any<EventId>(), Arg.Any<object>(), Arg.Any<Exception>(),
Arg.Any<Func<object, Exception?, string>>());
}
}
2 changes: 2 additions & 0 deletions API.Tests/Usings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
global using Xunit;
global using NSubstitute;
22 changes: 19 additions & 3 deletions API/API.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<None Remove="appsettings.Local.json.template" />
</ItemGroup>

<ItemGroup>
<Content Include="appsettings.Local.json.template" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10" />
<PackageReference Include="RestSharp" Version="112.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DataFacade\DataFacade.csproj" />
</ItemGroup>

</Project>
39 changes: 39 additions & 0 deletions API/Controllers/SiteController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Mvc;

namespace API.Controllers;

[Route("/")]
[ApiController]
public class SiteController(ILogger<SiteController> logger) : ControllerBase
{
private readonly ILogger<SiteController> _logger = logger;

[HttpGet]
public string GetHelloMessage()
{
_logger.LogInformation("URL: {URL}", Request.GetDisplayUrl());
return "Hello, I'm working :)";
}

[Route("testadmin")]
[Authorize(Policy="Admin")]
[HttpGet]
public string TestAdmin()
{
_logger.LogInformation("URL: {URL}", Request.GetDisplayUrl());
return "Authorized Admin";
}

[Route("testuser")]
[Authorize]
[HttpGet]
public string TestUser()
{
_logger.LogInformation("URL: {URL}", Request.GetDisplayUrl());
return "Authorized User";
}
}
Loading