default #2
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 characters
| name: default | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| env: | |
| DOTNET_NOLOGO: true | |
| NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | |
| jobs: | |
| build: | |
| permissions: | |
| checks: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| submodules: recursive | |
| - name: setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| cache: npm | |
| cache-dependency-path: ./**/package-lock.json | |
| node-version: 24.x | |
| - name: setup dotnet | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| cache: true | |
| cache-dependency-path: src/**/packages.lock.json | |
| global-json-file: global.json | |
| - name: install workloads | |
| run: dotnet workload restore && dotnet workload install wasm-tools | |
| - name: restore | |
| run: dotnet restore --locked-mode | |
| - name: build | |
| run: dotnet build src/App/Web/ManagedDoom.App.Web.csproj --no-restore | |
| publish: | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| needs: [build] | |
| permissions: | |
| checks: write | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| submodules: recursive | |
| - name: setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| cache: npm | |
| cache-dependency-path: ./**/package-lock.json | |
| node-version: 24.x | |
| - name: setup dotnet | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| cache: true | |
| cache-dependency-path: src/**/packages.lock.json | |
| global-json-file: global.json | |
| - name: install workloads | |
| run: dotnet workload restore && dotnet workload install wasm-tools | |
| - name: restore | |
| run: dotnet restore --locked-mode | |
| - name: publish | |
| run: dotnet publish src/App/Web/ManagedDoom.App.Web.csproj -o managed-doom-web -c Release -r linux-x64 --self-contained --no-restore && zip -r managed-doom-web-${{ github.event.release.tag_name }}.zip managed-doom-web | |
| - name: upload artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: managed-doom-web | |
| path: managed-doom-web | |
| - name: update release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: managed-doom-web-${{ github.event.release.tag_name }}.zip | |
| deploy: | |
| concurrency: live | |
| environment: live | |
| needs: [publish] | |
| permissions: | |
| contents: read | |
| deployments: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: download artifact | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: managed-doom-web | |
| path: managed-doom-web | |
| - name: az login | |
| uses: azure/login@v2 | |
| with: | |
| creds: ${{ secrets.MANAGED_DOOM_DEPLOY_RBAC }} | |
| - name: deploy app service | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: managed-doom | |
| clean: true | |
| package: managed-doom-web | |
| restart: true | |
| - name: az logout | |
| run: az logout |