Implement: CI/CD user, historyPlayback and content and Add Controllers #1
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: Compilar e implementar la aplicación de .NET Core en la aplicación web SpiderWatcherApiUser | |
on: | |
push: | |
branches: | |
- master | |
env: | |
AZURE_WEBAPP_NAME: SpiderWatcherApiUser | |
AZURE_WEBAPP_PACKAGE_PATH: ApiUser/publish | |
CONFIGURATION: Release | |
DOTNET_CORE_VERSION: 8.0.x | |
WORKING_DIRECTORY: ApiUser | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.DOTNET_CORE_VERSION }} | |
- name: Restore | |
run: dotnet restore "${{ env.WORKING_DIRECTORY }}" | |
- name: Build | |
run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore | |
- name: Test | |
run: dotnet test "${{ env.WORKING_DIRECTORY }}" --no-build | |
- name: Publish | |
run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}" | |
- name: Publish Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: webapp | |
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v3 | |
with: | |
name: webapp | |
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | |
- name: Deploy to Azure WebApp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: ${{ env.AZURE_WEBAPP_NAME }} | |
publish-profile: ${{ secrets.SpiderWatcherApiUser_05E0 }} | |
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} |