Skip to content

Commit

Permalink
ci: app creator (#648)
Browse files Browse the repository at this point in the history
* ci: app creator

* ci:

* ci: add script for creating fusion app

* ci: refine action
  • Loading branch information
Gustav-Eikaas authored Nov 2, 2023
1 parent b5576f5 commit 8e57f7f
Show file tree
Hide file tree
Showing 3 changed files with 310 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/create-fusion-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
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
description:
type: string
description: App description
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
jobs:
create-fusion-apps:
runs-on: ubuntu-latest
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'
shell: bash
run: npx ts-node --esm ./github-action/src/createFusionApp.ts -T ${{ env.FUSION_TOKEN }} -A ${{inputs.appKey}} -C ${{inputs.category}} -D ${{inputs.displayName}}
Loading

0 comments on commit 8e57f7f

Please sign in to comment.