Skip to content

Commit

Permalink
Try single build with two publishes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnield committed Feb 27, 2024
1 parent 677ff86 commit c18c822
Showing 1 changed file with 27 additions and 46 deletions.
73 changes: 27 additions & 46 deletions .github/workflows/main_kascouts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ on:
workflow_dispatch:

jobs:
# 1st KA
build-first:
build:
runs-on: ubuntu-latest

steps:
Expand All @@ -29,7 +28,7 @@ jobs:
- name: dotnet publish
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp

- name: Update App Settings
- name: Update Common App Settings
uses: microsoft/variable-substitution@v1
with:
files: ${{env.DOTNET_ROOT}}/myapp/appsettings.json
Expand All @@ -38,17 +37,36 @@ jobs:
auth.password: ${{secrets.AUTH_PASSWORD}}
OsmOptions.ClientId: ${{secrets.OSM_CLIENT_ID}}
OsmOptions.ClientSecret: ${{secrets.OSM_CLIENT_SECRET}}

- name: Update First App Settings
uses: microsoft/variable-substitution@v1
with:
files: ${{env.DOTNET_ROOT}}/myapp/appsettings.json
env:
OsmOptions.SectionId: 29148

- name: Upload artifact for deployment job
- name: Upload First artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: .net-app
name: first
path: ${{env.DOTNET_ROOT}}/myapp

- name: Update Fourth App Settings
uses: microsoft/variable-substitution@v1
with:
files: ${{env.DOTNET_ROOT}}/myapp/appsettings.json
env:
OsmOptions.SectionId: 15370

- name: Upload Fourth artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: fourth
path: ${{env.DOTNET_ROOT}}/myapp

deploy-first:
runs-on: ubuntu-latest
needs: build-first
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
Expand All @@ -59,7 +77,7 @@ jobs:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: .net-app
name: first

- name: Login to Azure
uses: azure/login@v1
Expand All @@ -76,46 +94,9 @@ jobs:
slot-name: 'Production'
package: .

# 4th KA
build-fourth:
runs-on: ubuntu-latest
needs: deploy-first

steps:
- uses: actions/checkout@v4

- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
include-prerelease: true

- name: Build with dotnet
run: dotnet build --configuration Release

- name: dotnet publish
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp

- name: Update App Settings
uses: microsoft/variable-substitution@v1
with:
files: ${{env.DOTNET_ROOT}}/myapp/appsettings.json
env:
auth.user: ${{secrets.AUTH_USER}}
auth.password: ${{secrets.AUTH_PASSWORD}}
OsmOptions.ClientId: ${{secrets.OSM_CLIENT_ID}}
OsmOptions.ClientSecret: ${{secrets.OSM_CLIENT_SECRET}}
OsmOptions.SectionId: 15370

- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: .net-app
path: ${{env.DOTNET_ROOT}}/myapp

deploy-fourth:
runs-on: ubuntu-latest
needs: build-fourth
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
Expand All @@ -126,7 +107,7 @@ jobs:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: .net-app
name: fourth

- name: Login to Azure
uses: azure/login@v1
Expand Down

0 comments on commit c18c822

Please sign in to comment.