-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (77 loc) · 2.9 KB
/
create-fusion-app.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
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Create Fusion App
on:
workflow_dispatch:
inputs:
appKey:
type: string
description: Fusion app key (This cant be changed!)
displayName:
type: string
description: Display name for fusion app
category:
type: choice
description: Fusion app category
options:
- Construction and Commissioning
- Corporate Project Review
- Portfolio Management
- Project control
- Organisation
- Project management
- Experience
- Marketing, Midstream and Processing
- Offshore Wind (OW)
- Fusion utilities
- Fusion administration
- Safety, Security and Sustainability
- Collaboration
- Project Development Centre (PDC)
- Quality and risk
- Engineering
- MMP Liquids
permissions: write-all
jobs:
create-fusion-app-ci:
runs-on: ubuntu-latest
environment: ci
steps:
- name: 'Login to Azure'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
allow-no-subscriptions: true
- name: 'Obtain fusion token'
shell: bash
run: echo "FUSION_TOKEN=$(az account get-access-token --resource '${{ secrets.AZURE_RESOURCE_ID }}' | jq '.accessToken')" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to fetch range
- name: Install Dependencies
run: npm i -g pnpm typescript && pnpm i
- name: 'Create application in Fusion CI'
shell: bash
run: npx ts-node --esm ./github-action/src/createFusionApp.ts create -T ${{ env.FUSION_TOKEN }} -A '${{inputs.appKey}}' -C '${{inputs.category}}' -D '${{inputs.displayName}}' -O '${{vars.FUSION_APP_ADMINS_CI}}' -E 'CI'
create-fusion-app-fprd:
runs-on: ubuntu-latest
environment: fprd
steps:
- name: 'Login to Azure'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_PROD_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
allow-no-subscriptions: true
- name: 'Obtain fusion token'
shell: bash
run: echo "FUSION_PROD_TOKEN=$(az account get-access-token --resource '${{ secrets.AZURE_RESOURCE_PROD_ID }}' | jq '.accessToken')" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to fetch range
- name: Install Dependencies
run: npm i -g pnpm typescript && pnpm i
- name: 'Create application in Fusion FPRD'
shell: bash
run: npx ts-node --esm ./github-action/src/createFusionApp.ts create -T ${{ env.FUSION_PROD_TOKEN }} -A '${{inputs.appKey}}' -C '${{inputs.category}}' -D '${{inputs.displayName}}' -O '${{vars.FUSION_APP_ADMINS_FPRD}}' -E 'FPRD'