Skip to content

Nuget package updates and some user friendliness (#9) #72

Nuget package updates and some user friendliness (#9)

Nuget package updates and some user friendliness (#9) #72

name: Deploy Guild Blazor app to Azure
on:
push:
branches: [ "main" ]
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [ "main" ]
# Environment variables available to all jobs and steps in this workflow
env:
APP_LOCATION: "/Src/Solarian.League.Web/Solarian.League.Web" # location of your client code
API_LOCATION: "/Src/Solarian.League.Web/Solarian.League.Api" # location of your api source code - optional
APP_ARTIFACT_LOCATION: "wwwroot" # location of client code build output
AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing deployment token for your static web app
BASE_URL: ${{ secrets.HTTPCLIENTS_BLIZZARDWRAPPERCLIENT_BASEURL }} # Base URL for the API
API_KEY: ${{ secrets.HTTPCLIENTS_BLIZZARDWRAPPERCLIENT_APIKEY }} # secret containing the API key for your application
permissions:
contents: read
jobs:
build_and_deploy_job:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: write # for Azure/static-web-apps-deploy to comment on PRs
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Update appsettings.json
#run: bash ./update_appsettings.sh ${{ env.BASE_URL }} ${{ env.API_KEY }}
run: pwsh ./update_appsettings.ps1 "${{ env.BASE_URL }}" "${{ env.API_KEY }}"
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match you app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: ${{ env.APP_LOCATION }}
api_location: ${{ env.API_LOCATION }}
app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }}
###### End of Repository/Build Configurations ######
close_pull_request_job:
permissions:
contents: none
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app
action: "close"