Skip to content

Commit

Permalink
Add OrcaHello publish profiles (#184)
Browse files Browse the repository at this point in the history
* Add github workflows for the OrcaHello UI and Api services
* Add local .pubxml files (without any secrets in them) for OrcaHello

Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
  • Loading branch information
dthaler authored Sep 17, 2024
1 parent 1958505 commit 6cb9573
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/OrcaHello.Web.Api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: OrcaHello.Web.Api

on:
push:
branches:
- main
paths:
- ModeratorFrontEnd/OrcaHello/OrcaHello.Web.Api/**
- ModeratorFrontEnd/OrcaHello/OrcaHello.Web.Shared/**
workflow_dispatch: # Allow manual workflow invocation from the Github Actions UI

env:
DOTNET_VERSION: 6.0.x
DOTNET_RUNTIME: win-x86
WORKING_DIR: ModeratorFrontEnd/OrcaHello/OrcaHello.Web.Api
PUBLISH_DIR: output
AZURE_APP_NAME: AIForOrcasDetections2

defaults:
run:
working-directory: ModeratorFrontEnd/OrcaHello/OrcaHello.Web.Api

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Dependencies
run: dotnet restore -r ${{ env.DOTNET_RUNTIME }}
- name: Build
run: dotnet build --no-restore -c Release -r ${{ env.DOTNET_RUNTIME }}
- name: Test
run: dotnet test --no-restore -r ${{ env.DOTNET_RUNTIME }}
- name: Publish
run: dotnet publish --no-restore -c Release -o './${{ env.PUBLISH_DIR }}'
- name: Artifacts cache
uses: actions/cache@v2
with:
path: ./${{ env.WORKING_DIR }}/${{ env.PUBLISH_DIR }}
key: ${{ github.sha }}-${{ env.AZURE_APP_NAME }}-${{ env.DOTNET_RUNTIME }}-artifacts
deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: read
steps:
- uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Artifacts cache
uses: actions/cache@v2
with:
path: ./${{ env.WORKING_DIR}}/${{ env.PUBLISH_DIR }}
key: ${{ github.sha }}-${{ env.AZURE_APP_NAME }}-${{ env.DOTNET_RUNTIME }}-artifacts
- name: Deploy to azure
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_APP_NAME }}
publish-profile: ${{ secrets.AZURE_ORCAHELLODETECTIONS_PUBLISH_PROFILE }}
package: ./${{ env.WORKING_DIR }}/${{ env.PUBLISH_DIR }}
72 changes: 72 additions & 0 deletions .github/workflows/OrcaHello.Web.UI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: OrcaHello.Web.UI

on:
push:
branches:
- main
paths:
- ModeratorFrontEnd/OrcaHello/OrcaHello.Web.UI/**
- ModeratorFrontEnd/OrcaHello/OrcaHello.Web.Shared/**
workflow_dispatch: # Allow manual workflow invocation from the Github Actions UI

env:
DOTNET_VERSION: 6.0.x
DOTNET_RUNTIME: win-x86
WORKING_DIR: ModeratorFrontEnd/OrcaHello/OrcaHello.Web.UI
PUBLISH_DIR: output
AZURE_APP_NAME: AIForOrcas2

defaults:
run:
working-directory: ModeratorFrontEnd/OrcaHello/OrcaHello.Web.UI

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Dependencies
run: dotnet restore -r ${{ env.DOTNET_RUNTIME }}
- name: Build
run: dotnet build --no-restore -c Release -r ${{ env.DOTNET_RUNTIME }}
- name: Test
run: dotnet test --no-restore -r ${{ env.DOTNET_RUNTIME }}
- name: Publish
run: dotnet publish --no-restore -c Release -o './${{ env.PUBLISH_DIR }}'
- name: Artifacts cache
uses: actions/cache@v2
with:
path: ./${{ env.WORKING_DIR }}/${{ env.PUBLISH_DIR }}
key: ${{ github.sha }}-${{ env.AZURE_APP_NAME }}-${{ env.DOTNET_RUNTIME }}-artifacts
deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: read
steps:
- uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Artifacts cache
uses: actions/cache@v2
with:
path: ./${{ env.WORKING_DIR}}/${{ env.PUBLISH_DIR }}
key: ${{ github.sha }}-${{ env.AZURE_APP_NAME }}-${{ env.DOTNET_RUNTIME }}-artifacts
- name: Deploy to azure
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_APP_NAME }}
publish-profile: ${{ secrets.AZURE_ORCAHELLO_PUBLISH_PROFILE }}
package: ./${{ env.WORKING_DIR }}/${{ env.PUBLISH_DIR }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<PublishProvider>AzureWebSite</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>https://aifororcasdetections2.azurewebsites.net</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>7aa0448f-f0e4-43c8-a833-5038e38aac22</ProjectGuid>
<MSDeployServiceURL>aifororcasdetections2.scm.azurewebsites.net:443</MSDeployServiceURL>
<DeployIisAppPath>AIForOrcasDetections2</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>true</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>true</EnableMSDeployBackup>
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
<UserName>$AIForOrcasDetections2</UserName>
<_SavePWD>true</_SavePWD>
<_DestinationType>AzureWebSite</_DestinationType>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<PublishProvider>AzureWebSite</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>https://aifororcas2.azurewebsites.net</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>77ab2826-1cf2-45dc-8322-10c94b982e2b</ProjectGuid>
<MSDeployServiceURL>aifororcas2.scm.azurewebsites.net:443</MSDeployServiceURL>
<DeployIisAppPath>AIForOrcas2</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>true</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>true</EnableMSDeployBackup>
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
<UserName>$AIForOrcas2</UserName>
<_SavePWD>true</_SavePWD>
<_DestinationType>AzureWebSite</_DestinationType>
<InstallAspNetCoreSiteExtension>false</InstallAspNetCoreSiteExtension>
</PropertyGroup>
</Project>

0 comments on commit 6cb9573

Please sign in to comment.