Update main_ourumbraco.yml #12
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
# 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 ASP app to Azure Web App - OurUmbraco | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
permissions: | |
contents: read #This is required for actions/checkout | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup MSBuild path | |
uses: microsoft/setup-msbuild@v1.0.2 | |
- name: Setup NuGet | |
uses: NuGet/setup-nuget@v1.0.5 | |
- name: Restore NuGet packages | |
run: nuget restore | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
- name: Set npm Python version to 3 | |
working-directory: ./OurUmbraco.Client | |
run: npm config set python python3 | |
- name: Install npm prerequisites | |
working-directory: ./OurUmbraco.Client | |
run: npm install gulp jshint gulp-jshint | |
- name: npm install | |
working-directory: ./OurUmbraco.Client | |
run: npm install | |
- name: Rebuild node-sass | |
working-directory: ./OurUmbraco.Client | |
run: npm rebuild node-sass | |
- name: Build project | |
working-directory: ./OurUmbraco.Client | |
run: gulp build | |
- name: Publish to folder | |
run: msbuild OurUmbraco.Site\OurUmbraco.Site.csproj /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="\published\" | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ASP-app | |
path: '/published/**' | |
deploy: | |
runs-on: windows-latest | |
needs: build | |
environment: | |
name: 'Production' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v4 | |
with: | |
name: ASP-app | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v3 | |
with: | |
app-name: 'OurUmbraco' | |
slot-name: 'Production' | |
package: . | |
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_0FC17FE9A9734A9DA6B635D58450BF82 }} |