Typo fix #46
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
name: Build and deploy to dev | |
env: | |
AZURE_WEBAPP_NAME: service-assessment-service # set this to the name of your Azure Web App | |
AZURE_WEBAPP_PACKAGE_PATH: "." # set this to the path to your web app project, defaults to the repository root | |
DOTNET_VERSION: "8.x" # set this to the .NET Core version to use | |
NODE_VERSION: '20' | |
APP_NAME: SAS-App | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Cache node_modules | |
id: node_modules-cache-webapp | |
uses: actions/cache@v4 | |
with: | |
path: ./src/ServiceAssessmentService/ServiceAssessmentService.WebApp/node_modules | |
key: ${{ runner.os }}-node_modules-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Install NPM dependencies (Web UI) | |
working-directory: ./src/ServiceAssessmentService/ServiceAssessmentService.WebApp | |
run: npm install | |
- name: Set up dependency caching for faster builds | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- name: Build Web UI (webpack) | |
working-directory: ./src/ServiceAssessmentService/ServiceAssessmentService.WebApp | |
run: npm run buildCi | |
- name: Verify formatting | |
working-directory: ./src/ServiceAssessmentService | |
run: dotnet format --no-restore --verify-no-changes | |
- name: Build with dotnet | |
working-directory: ./src/ServiceAssessmentService | |
run: dotnet build --configuration Release | |
- name: dotnet publish | |
working-directory: ./src/ServiceAssessmentService | |
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.APP_NAME }} | |
path: ${{env.DOTNET_ROOT}}/myapp | |
deploy: | |
permissions: | |
contents: none | |
runs-on: ubuntu-latest | |
needs: build | |
environment: | |
name: "Dev" | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.APP_NAME }} | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v3 | |
with: | |
app-name: ${{ env.AZURE_WEBAPP_NAME }} | |
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }} | |
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} |