Back out of fixing async methods, they don't mix well with views in .… #49
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/[email protected] | |
- name: Setup NuGet | |
uses: NuGet/[email protected] | |
- name: Restore NuGet packages | |
run: nuget restore | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
- name: npm install | |
working-directory: ./OurUmbraco.Client | |
run: npm install | |
- name: npm build | |
working-directory: ./OurUmbraco.Client | |
run: npm run build | |
- name: Replace secrets in web.vsts.config | |
run: | | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{connectionString}#', '${{ secrets.CONNECTION_STRING }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{connectionString2}#', '${{ secrets.CONNECTION_STRING2 }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{PackageAuthToken}#', '${{ secrets.PACKAGE_AUTH_TOKEN }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{uReleasePassword}#', '${{ secrets.URELEASE_PASSWORD }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{SlackWebhookSecret}#', '${{ secrets.SLACK_WEBHOOK_SECRET }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{AppVeyorWebHookAuthKey}#', '${{ secrets.APPVEYOR_WEBHOOK_AUTH_KEY }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{GoogleOAuthClientID}#', '${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{GoogleOAuthSecret}#', '${{ secrets.GOOGLE_OAUTH_SECRET }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{GoogleServerKey}#', '${{ secrets.GOOGLE_SERVER_KEY }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{reCaptchaPublicKey}#', '${{ secrets.RECAPTCHA_PUBLIC_KEY }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{reCaptchaPrivateKey}#', '${{ secrets.RECAPTCHA_PRIVATE_KEY }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{twitterConsumerKey}#', '${{ secrets.TWITTER_CONSUMER_KEY }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{twitterConsumerSecret}#', '${{ secrets.TWITTER_CONSUMER_SECRET }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{twitterUserAccessToken}#', '${{ secrets.TWITTER_USER_ACCESS_TOKEN }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{twitterUserAccessSecret}#', '${{ secrets.TWITTER_USER_ACCESS_SECRET }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{VimeoAccessToken}#', '${{ secrets.VIMEO_ACCESS_TOKEN }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{GitterApiToken}#', '${{ secrets.GITTER_API_TOKEN }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{GitHubUsername}#', '${{ secrets.GH_USERNAME }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{GitHubPassword}#', '${{ secrets.GH_PASSWORD }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{GitHubAccessToken}#', '${{ secrets.GH_ACCESS_TOKEN }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{GitHubUmbraBotAccessToken}#', '${{ secrets.GH_UMBRABOT_ACCESS_TOKEN }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{IpStackAccessKey}#', '${{ secrets.IP_STACK_ACCESS_KEY }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{GitHubClientId}#', '${{ secrets.GH_CLIENT_ID }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{GitHubClientSecret}#', '${{ secrets.GH_CLIENT_SECRET }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{IncomingWebHookAuthKey}#', '${{ secrets.INCOMING_WEBHOOK_AUTH_KEY }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{CosmosAuthKey}#', '${{ secrets.COSMOS_AUTH_KEY }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{CollabBearerToken}#', '${{ secrets.COLLAB_BEARER_TOKEN }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{DiscourseApiKey}#', '${{ secrets.DISCOURSE_API_KEY }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{smtpUsername}#', '${{ secrets.SMTP_USERNAME }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
(Get-Content OurUmbraco.Site/web.vsts.config) -replace '#{smtpPassword}#', '${{ secrets.SMTP_PASSWORD }}' | Set-Content OurUmbraco.Site/web.vsts.config | |
- 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: ubuntu-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: Login to Azure | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Stop App Service | |
uses: azure/cli@v1 | |
with: | |
azcliversion: 2.30.0 | |
inlineScript: az webapp stop --name OurUmbraco --resource-group ourumbracoappservice | |
- 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 }} | |
clean: false | |
- name: Start App Service | |
uses: azure/cli@v1 | |
with: | |
azcliversion: 2.30.0 | |
inlineScript: az webapp start --name OurUmbraco --resource-group ourumbracoappservice |