-
Notifications
You must be signed in to change notification settings - Fork 19
168 lines (149 loc) · 5.67 KB
/
generate-war.yml
File metadata and controls
168 lines (149 loc) · 5.67 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: generate-war
on:
workflow_dispatch:
inputs:
environment:
description: Target environment
type: choice
required: true
options:
- beta
- qa
- demo
basepath:
description: 'Server base path (without slashes) for serving the application (e.g., spa). If left blank, it will try to deploy to the root base path.'
type: string
required: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 22
cache: 'npm'
- name: Create .npmrc
run: |
cp .npmrc.example .npmrc
sed -i -e 's/<YOUR_GITHUB_AUTH_TOKEN>/${{ secrets.GITHUB_TOKEN }}/g' .npmrc
sed -i -e 's/<YOUR_NPM_AUTH_TOKEN>/${{ secrets.NPM_AUTH_TOKEN }}/g' .npmrc
- name: Install Dependencies
run: npm install
- name: Build Dataverse UI Library
working-directory: packages/design-system
run: npm run build
- name: Build with base path
run: npm run build -- --base=/${{ github.event.inputs.basepath }}
- name: Override runtime config.js for BETA
if: ${{ github.event.inputs.environment == 'beta' }}
env:
DATAVERSE_BACKEND_URL: ${{ secrets.BETA_DATAVERSE_BACKEND_URL }}
OIDC_CLIENT_ID: ${{ secrets.BETA_OIDC_CLIENT_ID }}
OIDC_AUTHORIZATION_ENDPOINT: ${{ secrets.BETA_OIDC_AUTHORIZATION_ENDPOINT }}
OIDC_TOKEN_ENDPOINT: ${{ secrets.BETA_OIDC_TOKEN_ENDPOINT }}
OIDC_LOGOUT_ENDPOINT: ${{ secrets.BETA_OIDC_LOGOUT_ENDPOINT }}
OIDC_STORAGE_KEY_PREFIX: ${{ secrets.BETA_OIDC_STORAGE_KEY_PREFIX }}
run: |
mkdir -p ./dist
cat > ./dist/config.js <<EOF
window.__APP_CONFIG__ = {
backendUrl: "${DATAVERSE_BACKEND_URL}",
oidc: {
clientId: "${OIDC_CLIENT_ID}",
authorizationEndpoint: "${OIDC_AUTHORIZATION_ENDPOINT}",
tokenEndpoint: "${OIDC_TOKEN_ENDPOINT}",
logoutEndpoint: "${OIDC_LOGOUT_ENDPOINT}",
localStorageKeyPrefix: "${OIDC_STORAGE_KEY_PREFIX}"
},
languages: [
{ code: 'en', name: 'English' },
{ code: 'es', name: 'Español' },
],
defaultLanguage: 'en'
}
EOF
- name: Override runtime config.js for QA
if: ${{ github.event.inputs.environment == 'qa' }}
env:
DATAVERSE_BACKEND_URL: ${{ secrets.QA_DATAVERSE_BACKEND_URL }}
OIDC_CLIENT_ID: ${{ secrets.QA_OIDC_CLIENT_ID }}
OIDC_AUTHORIZATION_ENDPOINT: ${{ secrets.QA_OIDC_AUTHORIZATION_ENDPOINT }}
OIDC_TOKEN_ENDPOINT: ${{ secrets.QA_OIDC_TOKEN_ENDPOINT }}
OIDC_LOGOUT_ENDPOINT: ${{ secrets.QA_OIDC_LOGOUT_ENDPOINT }}
OIDC_STORAGE_KEY_PREFIX: ${{ secrets.QA_OIDC_STORAGE_KEY_PREFIX }}
run: |
mkdir -p ./dist
cat > ./dist/config.js <<EOF
window.__APP_CONFIG__ = {
backendUrl: "${DATAVERSE_BACKEND_URL}",
oidc: {
clientId: "${OIDC_CLIENT_ID}",
authorizationEndpoint: "${OIDC_AUTHORIZATION_ENDPOINT}",
tokenEndpoint: "${OIDC_TOKEN_ENDPOINT}",
logoutEndpoint: "${OIDC_LOGOUT_ENDPOINT}",
localStorageKeyPrefix: "${OIDC_STORAGE_KEY_PREFIX}"
},
languages: [
{ code: 'en', name: 'English' },
{ code: 'es', name: 'Español' },
],
defaultLanguage: 'en'
}
EOF
- name: Override runtime config.js for DEMO
if: ${{ github.event.inputs.environment == 'demo' }}
env:
DATAVERSE_BACKEND_URL: ${{ secrets.DEMO_DATAVERSE_BACKEND_URL }}
OIDC_CLIENT_ID: ${{ secrets.DEMO_OIDC_CLIENT_ID }}
OIDC_AUTHORIZATION_ENDPOINT: ${{ secrets.DEMO_OIDC_AUTHORIZATION_ENDPOINT }}
OIDC_TOKEN_ENDPOINT: ${{ secrets.DEMO_OIDC_TOKEN_ENDPOINT }}
OIDC_LOGOUT_ENDPOINT: ${{ secrets.DEMO_OIDC_LOGOUT_ENDPOINT }}
OIDC_STORAGE_KEY_PREFIX: ${{ secrets.DEMO_OIDC_STORAGE_KEY_PREFIX }}
run: |
mkdir -p ./dist
cat > ./dist/config.js <<EOF
window.__APP_CONFIG__ = {
backendUrl: "${DATAVERSE_BACKEND_URL}",
oidc: {
clientId: "${OIDC_CLIENT_ID}",
authorizationEndpoint: "${OIDC_AUTHORIZATION_ENDPOINT}",
tokenEndpoint: "${OIDC_TOKEN_ENDPOINT}",
logoutEndpoint: "${OIDC_LOGOUT_ENDPOINT}",
localStorageKeyPrefix: "${OIDC_STORAGE_KEY_PREFIX}"
},
languages: [
{ code: 'en', name: 'English' },
{ code: 'es', name: 'Español' },
],
defaultLanguage: 'en'
}
EOF
- uses: actions/upload-artifact@v4
with:
name: built-site
path: ./dist
include-hidden-files: true
generate-war:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- uses: actions/download-artifact@v4
with:
name: built-site
path: ./dist
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v6
- name: Build war file
working-directory: ./deployment/payara
run: mvn package "-Dversion=${{ steps.branch-name.outputs.current_branch }}"
- uses: actions/upload-artifact@v4
with:
name: war-file
path: ./deployment/payara/target/*.war