exibindo logs completos da CategoryController #7
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
# 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 - dt-blog-2812 | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
ConnectionStrings__DefaultaConnection: ${{ secrets.DT_AZURE_CONNECTIONSTRING }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '8.x' | |
include-prerelease: true | |
- name: Azure Login | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.DT_AZURE_CREDENTIALS }} | |
- name: Get Current IP Address | |
id: ip | |
uses: haythem/public-ip@v1.2 | |
- name: Add IP address to SQL Server | |
run: az sql server firewall-rule create --resource-group blog --server blog2812server --name ghactions --start-ip-address ${{ steps.ip.outputs.ipv4 }} --end-ip-address ${{ steps.ip.outputs.ipv4 }} | |
- name: Install EF Tools | |
run: dotnet tool install --global dotnet-ef | |
- name: Build with dotnet | |
run: dotnet build --configuration Release | |
- name: Update Database | |
run: dotnet ef database update | |
- 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_C27234E9BE60497DA152F8414E5CDD40 }} | |
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_116DDCA3A9494727862B393092F10C10 }} | |
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_613B7BC2BABF49BCA45A10651D8783BC }} | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: 'dt-blog-2812' | |
slot-name: 'Production' | |
package: . | |