After this ADR
TITLE: ADR 006 - Deploy
- Title
- Status
- Evaluation criteria
- Candidates to consider
- Research and analysis of each candidate
- Does/doesn't meet criteria and why
- Cost analysis
- SWOT analysis
- Opinions and feedback
- Recommendation
Where and how to deploy
The deployment could be done automatically or manually.
The deployment could be on a cloud provider or on premise or on a hosted server.
For automatically, the easy solution is a Github Action because the code is on Github.
Status
Accepted
Evaluation criteria
Low cost - 10000
Easy of deployment - 10
Easy of maintenance - 10
Easy of monitoring - 10
Easy of scaling - 10
Easy of rollback - 10
Candidates to consider
Amazon
Azure
Hosted Server
Research and analysis of each candidate
Because of having a sponsored account on Azure, Azure is the first candidate to consider.
Also, Github Actions is integrated with Azure.
Recommendation
Azure
ADR based on
It was just creating the WebApp on Azure and letting generate the Github Action.
Now the only thing that I need to do is to integrate the documentation on wwwroot.
I have an Github workflow that is building the documentation and the site and running the tests.
The other Github file is taking the output of the build and deploying it to Azure.
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy ASP.Net Core app to Azure Web App - syncPowershell
on:
push:
branches:
- main
workflow_dispatch:
jobs:
mainBuild:
uses: ./.github/workflows/build.yml
build:
needs: [mainBuild]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
include-prerelease: false
# - name: Build with dotnet
# run: |
# cd src
# cd SyncPowershell
# dotnet build --configuration Release
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: docusaurusBuild
path: src/SyncPowershell/syncPowershellWebAPI/wwwroot/help/
- name: dotnet publish
run: |
cd src
cd SyncPowershell
cd syncPowershellWebAPI
dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: .net-app
path: ${{env.DOTNET_ROOT}}/myapp
retention-days: 1
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: .net-app
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'syncPowershell'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_49083FF1076F49D1AE72DCB84FCB1E50 }}
package: .