stronger typing on GameEventTypes #284
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
# GitHub Actions workflow file for deploying contents of "./src" as REST API to Azure web app on each git branch push and more. | |
# | |
# The intended target Azure static web app is "kojamroz VS Enterprise Sub / game-rg / game-api1", with publish profile secrets.AZURE_GAME_API1_PUBLISH_PROFILE | |
# https://portal.azure.com/#@spawarottijamro.onmicrosoft.com/resource/subscriptions/8695c84c-09a4-4b50-994f-a2fa7f36cc92/resourceGroups/game-rg/providers/Microsoft.Web/sites/game-api1/appServices | |
# | |
# This workflow file was originally generated via Azure web app deployment center | |
# yml 'name' property: "Build and deploy ASP.Net Core app to Azure Web App - api-game-lib" | |
# file name: main_api-game-lib.yml | |
# | |
# Later on I updated it based on | |
# - https://docs.github.com/en/actions/deployment/deploying-to-your-cloud-provider/deploying-to-azure/deploying-net-to-azure-app-service | |
# | |
# For details, see: | |
# - docs/api_backend_setup.md | |
name: API backend - Azure Web App CI/CD | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'src/**' | |
workflow_dispatch: | |
env: | |
DOTNET_CORE_VERSION: 8.x | |
API_SLN_DIR: .\src\api | |
PUBLISHED_DIR: .\published | |
AZURE_WEBAPP_NAME: game-api1 | |
CONFIGURATION: Release | |
DEPLOYMENT_SLOT_NAME: Production | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_CORE_VERSION }} | |
- name: Build with dotnet | |
run: dotnet build "${{ env.API_SLN_DIR }}" --configuration ${{ env.CONFIGURATION }} | |
- name: dotnet publish | |
run: dotnet publish "${{ env.API_SLN_DIR }}" --configuration ${{ env.CONFIGURATION }} --no-build --output ${{ env.PUBLISHED_DIR }} | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v4 | |
with: | |
name: .net-app | |
path: ${{ env.PUBLISHED_DIR }} | |
deploy: | |
runs-on: windows-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@v4 | |
with: | |
name: .net-app | |
path: ${{ env.PUBLISHED_DIR }} | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v3 | |
with: | |
app-name: ${{ env.AZURE_WEBAPP_NAME }} | |
slot-name: ${{ env.DEPLOYMENT_SLOT_NAME }} | |
package: ${{ env.PUBLISHED_DIR }} | |
publish-profile: ${{ secrets.AZURE_GAME_API1_PUBLISH_PROFILE }} |