-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 2.21 KB
/
pull-request.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
name: Pull request workflow
run-name: Running pull request flow for ${{ github.head_ref }}
concurrency: pull-request
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, closed]
permissions:
id-token: write
contents: read
pull-requests: write
jobs:
apply-pull-request-infrastructure:
uses: ./.github/workflows/reusable-apply-infrastructure.yaml
with:
suffix: ${{ github.head_ref }}
environment: preview
cloudSubDomain: preview.cloud
dotnetSubDomain: preview.dotnet
secrets: inherit
build-cloud-application:
if: github.event.action != 'closed'
uses: ./.github/workflows/reusable-build-application.yaml
with:
application: cloud
needs: [apply-pull-request-infrastructure]
deploy-cloud-application:
if: github.event.action != 'closed'
uses: ./.github/workflows/reusable-deploy-application.yaml
with:
application: cloud
storageAccount: ${{ needs.apply-pull-request-infrastructure.outputs.cloudStorageAccount }}
resourceGroup: ${{ needs.apply-pull-request-infrastructure.outputs.resourceGroup }}
environment: preview
needs: [apply-pull-request-infrastructure, build-cloud-application]
secrets: inherit
build-dotnet-application:
if: github.event.action != 'closed'
uses: ./.github/workflows/reusable-build-application.yaml
with:
application: dotnet
needs: [apply-pull-request-infrastructure]
deploy-dotnet-application:
if: github.event.action != 'closed'
uses: ./.github/workflows/reusable-deploy-application.yaml
with:
application: dotnet
storageAccount: ${{ needs.apply-pull-request-infrastructure.outputs.dotnetStorageAccount }}
resourceGroup: ${{ needs.apply-pull-request-infrastructure.outputs.resourceGroup }}
environment: preview
needs: [apply-pull-request-infrastructure, build-dotnet-application]
secrets: inherit
remove-infrastructure:
if: github.event.action == 'closed'
uses: ./.github/workflows/reusable-destroy-infrastructure.yaml
with:
environment: preview
resourcegroup: ${{ needs.apply-pull-request-infrastructure.outputs.resourceGroup }}
needs: [apply-pull-request-infrastructure]
secrets: inherit