-
Notifications
You must be signed in to change notification settings - Fork 24
81 lines (76 loc) · 2.68 KB
/
OrcaHello.Web.UI.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: OrcaHello.Web.UI
on:
pull_request:
branches:
- main
paths:
- ModeratorFrontEnd/OrcaHello/OrcaHello.Web.UI/**
- ModeratorFrontEnd/OrcaHello/OrcaHello.Web.Shared/**
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: 8.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
permissions: # added using https://github.com/step-security/secure-repo
contents: read
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@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set up .NET Core
uses: actions/setup-dotnet@608ee757cfcce72c2e91e99aca128e0cae67de87 # v1.9.1
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@8492260343ad570701412c2f464a5877dc76bace # 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@8492260343ad570701412c2f464a5877dc76bace # 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@4bfb30bef2c330e36be280cb1e5726d0fac06233 # v2.2.13
with:
app-name: ${{ env.AZURE_APP_NAME }}
publish-profile: ${{ secrets.AZURE_ORCAHELLO_PUBLISH_PROFILE }}
package: ./${{ env.WORKING_DIR }}/${{ env.PUBLISH_DIR }}