-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arranged frontend to deploy properly with appi connection
Jira ticket: CAMS-417
- Loading branch information
1 parent
c7fa4ce
commit 3ef1144
Showing
4 changed files
with
137 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
name: Build Frontend | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
nodeVersion: | ||
required: true | ||
type: string | ||
isDeployment: | ||
default: false | ||
type: boolean | ||
camsServerHostname: | ||
required: true | ||
type: string | ||
camsServerPort: | ||
required: true | ||
type: string | ||
camsServerProtocol: | ||
required: true | ||
type: string | ||
camsBasePath: | ||
required: true | ||
type: string | ||
webappName: | ||
required: true | ||
type: string | ||
environment: | ||
required: true | ||
type: string | ||
launchDarklyEnvironment: | ||
required: true | ||
type: string | ||
azResourceGrpAppEncrypted: | ||
required: true | ||
type: string | ||
jobs: | ||
frontend: | ||
defaults: | ||
run: | ||
working-directory: user-interface | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
environment: ${{ vars.AZURE_ENVIRONMENT }} | ||
|
||
- uses: cloudposse/github-action-secret-outputs@main | ||
id: rgApp | ||
with: | ||
secret: ${{ secrets.PGP_SIGNING_PASSPHRASE }} | ||
op: decode | ||
in: ${{ inputs.azResourceGrpAppEncrypted }} | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.nodeVersion }} | ||
cache: "npm" | ||
cache-dependency-path: user-interface/package-lock.json | ||
|
||
- name: Execute Build | ||
run: | | ||
pushd ../common | ||
npm ci | ||
popd | ||
appiString=$(az monitor app-insights component show --app appi-${{ inputs.webappName }} -g ${{ steps.rgApp.outputs.out }} --query "connectionString" -o tsv || true) | ||
npm ci | ||
export CAMS_SERVER_HOSTNAME=${{ inputs.camsServerHostname }} | ||
export CAMS_SERVER_PORT=${{ inputs.camsServerPort }} | ||
export CAMS_SERVER_PROTOCOL=${{ inputs.camsServerProtocol }} | ||
export CAMS_BASE_PATH=${{ inputs.camsBasePath }} | ||
export CAMS_APPLICATIONINSIGHTS_CONNECTION_STRING="${appiString}" | ||
export CAMS_FEATURE_FLAG_CLIENT_ID="${{ secrets.LD_DEVELOPMENT_CLIENT_ID }}" | ||
export CAMS_LAUNCH_DARKLY_ENV="${{ inputs.launchDarklyEnvironment }}" | ||
export CAMS_LOGIN_PROVIDER=${{ vars.CAMS_LOGIN_PROVIDER }} | ||
export CAMS_LOGIN_PROVIDER_CONFIG='${{ vars.CAMS_LOGIN_PROVIDER_CONFIG }}' | ||
export CAMS_INFO_SHA=${{ github.sha }} | ||
npm run build --if-present | ||
- name: Package | ||
if: inputs.isDeployment | ||
run: | | ||
pushd ./build | ||
zip -r ./${{ inputs.webappName }}.zip . | ||
popd | ||
mkdir ./artifacts | ||
mv ./build/${{ inputs.webappName }}.zip ./artifacts/ | ||
- name: Upload Frontend Artifact | ||
if: inputs.isDeployment | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ inputs.webappName }}-build | ||
path: user-interface/artifacts/ | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,56 +33,24 @@ on: | |
launchDarklyEnvironment: | ||
required: true | ||
type: string | ||
azResourceGrpAppEncrypted: | ||
required: true | ||
type: string | ||
jobs: | ||
frontend: | ||
defaults: | ||
run: | ||
working-directory: user-interface | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.nodeVersion }} | ||
cache: "npm" | ||
cache-dependency-path: user-interface/package-lock.json | ||
|
||
- name: Execute Build | ||
run: | | ||
pushd ../common | ||
npm ci | ||
popd | ||
npm ci | ||
export CAMS_SERVER_HOSTNAME=${{ inputs.camsServerHostname }} | ||
export CAMS_SERVER_PORT=${{ inputs.camsServerPort }} | ||
export CAMS_SERVER_PROTOCOL=${{ inputs.camsServerProtocol }} | ||
export CAMS_BASE_PATH=${{ inputs.camsBasePath }} | ||
export CAMS_APPLICATIONINSIGHTS_CONNECTION_STRING="${{ secrets.AZ_APPINSIGHTS_WEBAPP_CONNECTION_STRING }}" | ||
export CAMS_FEATURE_FLAG_CLIENT_ID="${{ secrets.LD_DEVELOPMENT_CLIENT_ID }}" | ||
export CAMS_LAUNCH_DARKLY_ENV="${{ inputs.launchDarklyEnvironment }}" | ||
export CAMS_LOGIN_PROVIDER=${{ vars.CAMS_LOGIN_PROVIDER }} | ||
export CAMS_LOGIN_PROVIDER_CONFIG='${{ vars.CAMS_LOGIN_PROVIDER_CONFIG }}' | ||
export CAMS_INFO_SHA=${{ github.sha }} | ||
npm run build --if-present | ||
- name: Package | ||
run: | | ||
pushd ./build | ||
zip -r ./${{ inputs.webappName }}.zip . | ||
popd | ||
mkdir ./artifacts | ||
mv ./build/${{ inputs.webappName }}.zip ./artifacts/ | ||
- name: Upload Frontend Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ inputs.webappName }}-build | ||
path: user-interface/artifacts/ | ||
if-no-files-found: error | ||
build-frontend-predeployment: | ||
name: Build Frontend Predeployment | ||
uses: ./.github/workflows/reusable-build-frontend.yml | ||
secrets: inherit # pragma: allowlist secret | ||
with: | ||
nodeVersion: ${{ vars.NODE_VERSION }} | ||
camsServerHostname: ${{ inputs.apiFunctionName }}.azurewebsites.us | ||
camsServerPort: ${{ vars.CAMS_SERVER_PORT }} | ||
camsServerProtocol: ${{ vars.CAMS_SERVER_PROTOCOL }} | ||
camsBasePath: ${{ vars.CAMS_BASE_PATH }} | ||
webappName: ${{ inputs.webappName }} | ||
environment: ${{ inputs.environment }} | ||
launchDarklyEnvironment: ${{ vars.CAMS_LAUNCH_DARKLY_ENV }} | ||
azResourceGrpAppEncrypted: ${{ inputs.azResourceGrpAppEncrypted }} | ||
|
||
backend: | ||
defaults: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters