Created
October 23, 2022 08:48
Revisions
-
m-jovanovic created this gist
Oct 23, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,58 @@ name: Publish Development π on: workflow_dispatch: push: branches: - main env: AZURE_WEBAPP_NAME: dev-api-trainersphere AZURE_WEBAPP_PACKAGE_PATH: "./publish" DOTNET_VERSION: "6.0.x" CONNECTIONSTRINGS__DATABASE: "<Replaced by Bundle>" jobs: publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Setup .NET Core π¦ uses: actions/setup-dotnet@v1 with: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Install dependencies π run: dotnet restore ./src/App - name: Build π§± run: dotnet build ./src/App --configuration Release --no-restore - name: Test π§ͺ run: dotnet test ./src/App --configuration Release --no-build --verbosity normal - name: Install EF Tool π¦ run: | dotnet new tool-manifest dotnet tool install dotnet-ef --version 6.0.3 - name: Create migration bundles π¦ run: | dotnet ef migrations bundle --configuration Bundle --verbose --startup-project ./src/App --project ./src/Modules/Users/Modules.Users.Persistence --context UsersDbContext --output users-bundle.exe dotnet ef migrations bundle --configuration Bundle --verbose --startup-project ./src/App --project ./src/Modules/Training/Modules.Training.Persistence --context TrainingDbContext --output training-bundle.exe dotnet ef migrations bundle --configuration Bundle --verbose --startup-project ./src/App --project ./src/Modules/Notifications/Modules.Notifications.Persistence --context NotificationsDbContext --output notifications-bundle.exe - name: Apply migration bundles π© run: | ./users-bundle.exe --connection '${{ secrets.DEV_CONNECTION_STRING }}' --verbose ./training-bundle.exe --connection '${{ secrets.DEV_CONNECTION_STRING }}' --verbose ./notifications-bundle.exe --connection '${{ secrets.DEV_CONNECTION_STRING }}' --verbose - name: Publish π run: dotnet publish ./src/App --configuration Release --no-build --output '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}' - name: Deploy to Azure π uses: azure/webapps-deploy@v2 with: app-name: ${{ env.AZURE_WEBAPP_NAME }} publish-profile: ${{ secrets.DEV_AZURE_PUBLISH_PROFILE }} package: "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}"