Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 4 #142

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 0 additions & 116 deletions .github/workflows/azure-webapps-dotnet-core.yml

This file was deleted.

76 changes: 55 additions & 21 deletions .github/workflows/deploy-to-dev.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,97 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy to dev

env:
AZURE_WEBAPP_NAME: service-assessment-service-dev
AZURE_WEBAPP_PACKAGE_PATH: "./src"
DOTNET_VERSION: "7.x"
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: "7.x" # set this to the .NET Core version to use
APP_NAME: SAS-App

on:
push:
branches:
- main
branches: ["main"]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: windows-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.x"
include-prerelease: true
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Setup Node.js environment
uses: actions/[email protected]
with:
## NOTE: dfe-frontend-alpha advertises requirement of node 16, with console warnings/errors if using more recent version
node-version: 16

- name: Cache node_modules
id: node_modules-cache-webapp
uses: actions/cache@v3
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@v3
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@v3
uses: actions/upload-artifact@v4
with:
name: .net-app
name: ${{ env.APP_NAME }}
path: ${{env.DOTNET_ROOT}}/myapp

deploy:
runs-on: windows-latest
permissions:
contents: none
runs-on: ubuntu-latest
needs: build
environment:
name: "Production"
name: "Dev"
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: .net-app
name: ${{ env.APP_NAME }}

- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
uses: azure/webapps-deploy@v3
with:
app-name: "service-assessment-service"
slot-name: "Production"
package: .
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
57 changes: 0 additions & 57 deletions .github/workflows/main_service-assessment-service.yml

This file was deleted.