From 9ccd5e0f265a36f2e367b1a3e08a23ae78948016 Mon Sep 17 00:00:00 2001 From: Omer Fahim Date: Tue, 7 Oct 2025 17:09:33 -0400 Subject: [PATCH 1/2] Added internal to deploy.yml --- .github/workflows/deploy.yml | 52 +++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a4c29ce52..5225fa6d7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,6 +11,7 @@ on: - beta - qa - demo + - internal 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 @@ -80,7 +81,7 @@ jobs: echo VITE_OIDC_LOGOUT_ENDPOINT="$OIDC_LOGOUT_ENDPOINT" >> .env echo VITE_OIDC_STORAGE_KEY_PREFIX="$OIDC_STORAGE_KEY_PREFIX" >> .env shell: bash - + # For DEMO environment - name: Create and populate .env file for DEMO if: ${{ github.event.inputs.environment == 'demo' }} @@ -101,6 +102,26 @@ jobs: echo VITE_OIDC_STORAGE_KEY_PREFIX="$OIDC_STORAGE_KEY_PREFIX" >> .env shell: bash + # For INTERNAL environment + - name: Create and populate .env file for INTERNAL + if: ${{ github.event.inputs.environment == 'internal' }} + env: + DATAVERSE_BACKEND_URL: ${{ secrets.INTERNAL_DATAVERSE_BACKEND_URL }} + OIDC_CLIENT_ID: ${{ secrets.INTERNAL_OIDC_CLIENT_ID }} + OIDC_AUTHORIZATION_ENDPOINT: ${{ INTERNAL.DEMO_OIDC_AUTHORIZATION_ENDPOINT }} + OIDC_TOKEN_ENDPOINT: ${{ secrets.INTERNAL_OIDC_TOKEN_ENDPOINT }} + OIDC_LOGOUT_ENDPOINT: ${{ secrets.INTERNAL_OIDC_LOGOUT_ENDPOINT }} + OIDC_STORAGE_KEY_PREFIX: ${{ secrets.INTERNAL_OIDC_STORAGE_KEY_PREFIX }} + run: | + touch .env + echo VITE_DATAVERSE_BACKEND_URL="$DATAVERSE_BACKEND_URL" >> .env + echo VITE_OIDC_CLIENT_ID="$OIDC_CLIENT_ID" >> .env + echo VITE_OIDC_AUTHORIZATION_ENDPOINT="$OIDC_AUTHORIZATION_ENDPOINT" >> .env + echo VITE_OIDC_TOKEN_ENDPOINT="$OIDC_TOKEN_ENDPOINT" >> .env + echo VITE_OIDC_LOGOUT_ENDPOINT="$OIDC_LOGOUT_ENDPOINT" >> .env + echo VITE_OIDC_STORAGE_KEY_PREFIX="$OIDC_STORAGE_KEY_PREFIX" >> .env + shell: bash + - name: Build with base path run: npm run build -- --base=/${{ github.event.inputs.basepath }} @@ -171,6 +192,18 @@ jobs: target: '/tmp' overwrite: true + # For INTERNAL environment + - name: Copy war file to remote INTERNAL instance + if: ${{ github.event.inputs.environment == 'internal' }} + uses: appleboy/scp-action@master + with: + host: ${{ secrets.INTERNAL_PAYARA_INSTANCE_HOST }} + username: ${{ secrets.INTERNAL_PAYARA_INSTANCE_USERNAME }} + key: ${{ secrets.INTERNAL_PAYARA_INSTANCE_SSH_PRIVATE_KEY }} + source: './deployment/payara/target/dataverse-frontend.war' + target: '/tmp' + overwrite: true + # For BETA environment - name: Execute payara war deployment remotely on BETA if: ${{ github.event.inputs.environment == 'beta' }} @@ -218,3 +251,20 @@ jobs: DATAVERSE_FRONTEND=`$ASADMIN list-applications |grep $APPLICATION_NAME |awk '{print $1}'` $ASADMIN undeploy $DATAVERSE_FRONTEND $ASADMIN deploy --name $APPLICATION_NAME --contextroot /${{ github.event.inputs.basepath }} $APPLICATION_WAR_PATH + + # For INTERNAL environment + - name: Execute payara war deployment remotely on INTERNAL + if: ${{ github.event.inputs.environment == 'internal' }} + uses: appleboy/ssh-action@v1.2.2 + with: + host: ${{ secrets.INTERNAL_PAYARA_INSTANCE_HOST }} + username: ${{ secrets.INTERNAL_PAYARA_INSTANCE_USERNAME }} + key: ${{ secrets.INTERNAL_PAYARA_INSTANCE_SSH_PRIVATE_KEY }} + script: | + APPLICATION_NAME=dataverse-frontend + APPLICATION_WAR_PATH=/tmp/deployment/payara/target/$APPLICATION_NAME.war + ASADMIN='/usr/local/payara6/bin/asadmin --user admin' + DATAVERSE_FRONTEND=`$ASADMIN list-applications |grep $APPLICATION_NAME |awk '{print $1}'` + $ASADMIN undeploy $DATAVERSE_FRONTEND + $ASADMIN deploy --name $APPLICATION_NAME --contextroot /${{ github.event.inputs.basepath }} $APPLICATION_WAR_PATH + From fc31a89e4c03efaca594c98e5967233949d68a28 Mon Sep 17 00:00:00 2001 From: Cheng Shi Date: Fri, 10 Oct 2025 18:06:06 -0400 Subject: [PATCH 2/2] chore: fix lint error --- .github/workflows/deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5225fa6d7..b2b659aee 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -81,7 +81,7 @@ jobs: echo VITE_OIDC_LOGOUT_ENDPOINT="$OIDC_LOGOUT_ENDPOINT" >> .env echo VITE_OIDC_STORAGE_KEY_PREFIX="$OIDC_STORAGE_KEY_PREFIX" >> .env shell: bash - + # For DEMO environment - name: Create and populate .env file for DEMO if: ${{ github.event.inputs.environment == 'demo' }} @@ -267,4 +267,3 @@ jobs: DATAVERSE_FRONTEND=`$ASADMIN list-applications |grep $APPLICATION_NAME |awk '{print $1}'` $ASADMIN undeploy $DATAVERSE_FRONTEND $ASADMIN deploy --name $APPLICATION_NAME --contextroot /${{ github.event.inputs.basepath }} $APPLICATION_WAR_PATH -