1
1
name : Deploy Site
2
+ run-name : Deploy Site - CDN${{ inputs.deploy-widgets && ', Widgets' || '' }}${{ inputs.deploy-lists && ', Lists' || '' }}
2
3
on :
3
4
workflow_dispatch :
5
+ inputs :
6
+ environment :
7
+ type : environment
8
+ deploy-widgets :
9
+ description : Pack and deploy widgets
10
+ type : boolean
11
+ default : false
12
+ deploy-lists :
13
+ description : Deploy lists (TBD)
14
+ type : boolean
15
+ default : false
4
16
5
17
jobs :
6
18
deploy :
12
24
working-directory : site
13
25
14
26
steps :
27
+ # ######### Preparation ##########
15
28
16
29
# Checkout the code
17
30
- name : Checkout branch
18
- uses : actions/checkout@v3
31
+ uses : actions/checkout@v3
32
+
33
+ # Sets up our deployment
34
+ - uses : " ./.github/workflows/composite/setup"
35
+
36
+ # Package the widgets (must run before build)
37
+ - name : Package Widgets
38
+ if : inputs.deploy-widgets
39
+ # TO-DO: Implement tokenMap
40
+ # run: npm run package ${{ inputs.widget_name }} -- --tokenMap ${{ inputs.token_map }}
41
+ run : npm run package
42
+
43
+ # Runs webpack to copy the source to the build folder
44
+ - name : Build
45
+ run : npm run build${{ inputs.environment == 'Prod' && '-prod-ci' || ''}}
46
+
47
+ # ######### Deploy CDN Assets ##########
48
+
49
+ # Assumption is that we always want to update these because deploying widgets needs the widget views on the CDN.
50
+
51
+ # Set the deployment type
52
+ - uses : " ./.github/workflows/composite/deployment_type"
53
+ with :
54
+ deployment_type : " cdnassets"
55
+
56
+ # Runs akumina-widget-builder with the cdnpackage option to prep widgets for deployment
57
+ - name : Package Widgets for CDN
58
+ if : inputs.deploy-widgets
59
+ run : npm run cdnpackage
60
+
61
+ # Runs site deployer
62
+ - name : Deploy to CDN
63
+ run : npm run deploy
64
+ env :
65
+ assetdirectory : Client
66
+ azurestorageaccountkey : ${{ secrets.azure_storage_account_key }}
67
+ azurestorageaccountname : ${{ vars.azure_storage_account_name }}
68
+ azurestoragecontainer : ${{ vars.azure_storage_account_container }}
69
+ spdirectory : DigitalWorkplace
70
+ envdir : build
71
+
72
+ # ######### Deploy Widgets ##########
73
+
74
+ # run: npm run package ${{ inputs.widget_name }} -- --tokenMap ${{ inputs.token_map }}
75
+
76
+ # Set the deployment type
77
+ - uses : " ./.github/workflows/composite/deployment_type"
78
+ if : inputs.deploy-widgets
79
+ with :
80
+ deployment_type : " widgets"
81
+
82
+ # Runs site deployer
83
+ - name : Deploy Widgets
84
+ if : inputs.deploy-widgets
85
+ run : npm run deploy
86
+ env :
87
+ assetdirectory : Client
88
+ clientid : ${{ secrets.client_id}}
89
+ clientsecret : ${{ secrets.client_secret }}
90
+ # Current assumption is that all widget instances are deployed to the Delivery site
91
+ # If we ever go multi-site then we will have to reconsider if this is the correct mechanism
92
+ spurl : ${{ vars.delivery_sp_url }}
93
+ centralspurl : ${{ vars.central_sp_url }}
94
+ spdirectory : DigitalWorkplace
95
+ langid : 1033
96
+ appmanagerurl : ${{ vars.appmanager_url }}
97
+ akquerykey : ${{ secrets.ak_query_key }}
98
+ ml : true
99
+ envdir : build
100
+
101
+ # ######### Deploy Lists ##########
102
+
103
+ # TBD
104
+
105
+ # ######### Cleanup ##########
106
+
107
+ # Stores an artifact copy on the workflow run
108
+ - name : Upload built artifact
109
+ uses : actions/upload-artifact@v4
110
+ with :
111
+ path : site/build
0 commit comments