generated from frasermolyneux-archive/poc-terraform-template
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (60 loc) · 2.32 KB
/
release-to-poc.yml
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
name: Release to POC
on:
workflow_dispatch:
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
terraform-plan-and-apply-poc:
environment: POC
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: frasermolyneux/actions/terraform-plan-and-apply@main
with:
terraform-folder: "terraform"
terraform-var-file: "tfvars/poc.tfvars"
backend-subscription-id: ${{ secrets.tf_backend_subscription_id }}
backend-resource-group-name: ${{ secrets.tf_backend_resource_group_name }}
backend-storage-account-name: ${{ secrets.tf_backend_storage_account_name }}
backend-container-name: ${{ secrets.tf_backend_container_name }}
backend-key: ${{ secrets.tf_backend_key }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- id: terraform-output
shell: bash
run: |
cd terraform
echo "logic_apps=$(terraform output -json logic_apps)" >> $GITHUB_OUTPUT
env:
ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
ARM_USE_OIDC: true
outputs:
logic_apps: ${{ steps.terraform-output.outputs.logic_apps }}
apps-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: frasermolyneux/actions/logic-app-ci@main
with:
logic-project: "logic-app"
src-folder: "src"
logic-app-deploy-poc:
environment: POC
runs-on: ubuntu-latest
strategy:
matrix:
func_app: ${{ fromJSON(needs.terraform-plan-and-apply-poc.outputs.logic_apps) }}
needs: [apps-ci, terraform-plan-and-apply-poc]
steps:
- uses: actions/checkout@v3
- uses: frasermolyneux/actions/deploy-logic-app@main
with:
logic-app-artifact-name: "logic-app"
logic-app-name: ${{ matrix.func_app.name }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}