Skip to content

Update notification handling logic #217

Update notification handling logic

Update notification handling logic #217

name: Azure Static Web Apps CI/CD
on:
push:
branches:
- main
- staging
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main
- staging
jobs:
build_and_deploy_job:
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
- shell: pwsh
run: |
.\deploy\deploy-configuration.ps1 `
-ClientID ${{ secrets.CLIENT_ID }} `
-ApplicationIdURI ${{ secrets.APPLICATION_ID_URI }} `
-IntrumentationKey ${{ secrets.INSTRUMENTATION_KEY }} `
-WebPushPublicKey ${{ secrets.WEB_PUSH_PUBLIC_KEY }} `
-AppRootFolder "src/MyChess.Client/wwwroot"
- uses: actions/setup-node@v3
with:
node-version: '14'
- name: Download .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- name: Build MyChess.Client
run: dotnet publish ./src/MyChess.Client/MyChess.Client.csproj -c Release -o Output
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_LEMON_SEA_03362AF03 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
production_branch: main
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
skip_app_build: true
app_location: "Output/wwwroot" # App source code path
api_location: "src/MyChess.Functions" # Api source code path - optional
output_location: "" # Built app content directory - optional
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.ref_name != 'staging'
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: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_LEMON_SEA_03362AF03 }}
action: "close"