Adjusts in swagger #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, tests and deploy | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./src/MayTheFourth | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET 8.0 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Display dotnet version | |
run: dotnet --version | |
- name: Installing EF Tools | |
run: dotnet tool install --global dotnet-ef | |
- name: Installing dependencies | |
run: dotnet restore | |
- name: Building | |
run: dotnet build --configuration Release | |
- name: Testing | |
run: dotnet test | |
- name: dotnet publish | |
run: 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 | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
environment: | |
name: 'Production' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
permissions: | |
id-token: write #This is required for requesting the JWT | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v3 | |
with: | |
name: .net-app | |
- name: Login to Azure | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_92706F8088EA47AFB6CEEDD7CE075A04 }} | |
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_9775EAB261E9430499B4ADCFC4A5D4EE }} | |
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_C7E1F589B638464F9FC8D2B8C7C878CE }} | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: 'MayTheFourthAPI' | |
slot-name: 'Production' | |
package: . |