Skip to content

update: Client version 0.9.10.6 -> 0.9.10.7 #124

update: Client version 0.9.10.6 -> 0.9.10.7

update: Client version 0.9.10.6 -> 0.9.10.7 #124

#---------------------------------------------------------------------------------------
# deploy-client-application.yml
# refer to https://learn.microsoft.com/ja-jp/azure/app-service/deploy-github-actions
#---------------------------------------------------------------------------------------
name: Deploy Client application
on:
push:
branches:
- main
- dev
paths:
- '.github/workflows/deploy-client-application.yml'
- 'src/PheasantTails.TwiHigh.BlazorApp/**'
- 'src/PheasantTails.TwiHigh.BlazorApp.Client/**'
- 'src/PheasantTails.TwiHigh.Data.Model/**'
- 'src/PheasantTails.TwiHigh.Interface/**'
env:
# Set web apps name.
AZURE_WEBAPP_NAME_PRO: twihigh-pro-client
AZURE_WEBAPP_NAME_DEV: twihigh-dev-client
# Set this to the path to your web app project, defaults to the repository root.
AZURE_WEBAPP_PACKAGE_PATH: '.'
# Set this to the dot net version to use
DOTNET_VERSION: '8.0.203'
PROJECT_FILE_PATH: 'src/PheasantTails.TwiHigh.BlazorApp/PheasantTails.TwiHigh.BlazorApp.csproj'
jobs:
pro-build-and-deploy-client:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: pro-client
name: PRO:Build and Deploy Client
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install .NET WebAssembly Tools
run: dotnet workload install wasm-tools
- name: 'Create licence list json'
shell: bash
run: |
pushd './src/PheasantTails.TwiHigh.Client/'
dotnet tool install --global dotnet-project-licenses
dotnet-project-licenses -i . -j true -f wwwroot
rm -f wwwroot/appsettings.Development.json
popd
- name: Build And Deploy Client
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PRO }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: "upload"
# ref: https://aka.ms/swaworkflowconfig
app_location: "src/PheasantTails.TwiHigh.Client" # App source code path
output_location: "wwwroot" # Built app content directory - optional
build_timeout_in_minutes: 30
skip_api_build: true
production_branch: "main"
# Build and deploy to dev env.
dev-build-and-deploy-client:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
environment: dev-client
name: DEV:Build and Deploy Client
steps:
# Checkout the repo
- uses: actions/checkout@v2
with:
submodules: true
# Setup dotnet SDK
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Install .NET WebAssembly Tools
- name: Install .NET WebAssembly Tools
run: dotnet workload install wasm-tools
# Run dotnet build and publish
- name: dotnet build and publish
run: |
dotnet restore ${{ env.PROJECT_FILE_PATH }}
dotnet build ${{ env.PROJECT_FILE_PATH }} --configuration Release --runtime linux-x64
dotnet publish ${{ env.PROJECT_FILE_PATH }} --configuration Release --runtime linux-x64 --property:PublishDir='${{ github.workspace }}/BlazorApp'
# Create licence list json
- name: 'Create licence list json'
shell: bash
run: |
pushd './src/PheasantTails.TwiHigh.BlazorApp.Client/'
dotnet tool install --global dotnet-project-licenses
dotnet-project-licenses -i . -j true -f ${{ github.workspace }}/BlazorApp/wwwroot
popd
- name: 'Show Blazor app folder'
shell: bash
run: |
pushd ${{ github.workspace }}/BlazorApp
pwd;find . | sort | sed '1d;s/^\.//;s/\/\([^/]*\)$/|--\1/;s/\/[^/|]*/| /g'
popd
# Deploy to Azure Web apps
- name: 'Run Azure webapp deploy action using publish profile credentials'
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME_DEV }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_DEV_CLIENT }}
package: '${{ github.workspace }}/BlazorApp'