Skip to content

Commit

Permalink
Merge pull request #164 from IQSS/fix/161-flat-secrets-beta-testing-d…
Browse files Browse the repository at this point in the history
…eploy

Update the beta-testing deploy GitHub action to use "flat" GitHub secrets
  • Loading branch information
kcondon authored Sep 11, 2023
2 parents b44205d + 01c9695 commit dca9519
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/deploy-beta-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: beta-testing

steps:
- uses: actions/checkout@v3
Expand All @@ -33,7 +32,7 @@ jobs:

- name: Create and populate .env file
env:
DATAVERSE_BACKEND_URL: ${{ secrets.DATAVERSE_BACKEND_URL }}
DATAVERSE_BACKEND_URL: ${{ secrets.BETA_DATAVERSE_BACKEND_URL }}
run: |
touch .env
echo VITE_DATAVERSE_BACKEND_URL="$DATAVERSE_BACKEND_URL" >> .env
Expand All @@ -50,7 +49,6 @@ jobs:
deploy-to-payara:
needs: build
runs-on: ubuntu-latest
environment: beta-testing

steps:
- uses: actions/checkout@v3
Expand All @@ -76,23 +74,23 @@ jobs:
- name: Copy war file to remote instance
uses: appleboy/scp-action@master
with:
host: ${{ secrets.PAYARA_INSTANCE_HOST }}
username: ${{ secrets.PAYARA_INSTANCE_USERNAME }}
key: ${{ secrets.PAYARA_INSTANCE_SSH_PRIVATE_KEY }}
host: ${{ secrets.BETA_PAYARA_INSTANCE_HOST }}
username: ${{ secrets.BETA_PAYARA_INSTANCE_USERNAME }}
key: ${{ secrets.BETA_PAYARA_INSTANCE_SSH_PRIVATE_KEY }}
source: './deployment/payara/target/dataverse-frontend.war'
target: '/home/${{ secrets.PAYARA_INSTANCE_USERNAME }}'
target: '/home/${{ secrets.BETA_PAYARA_INSTANCE_USERNAME }}'
overwrite: true

- name: Execute payara war deployment remotely
uses: appleboy/[email protected]
with:
host: ${{ secrets.PAYARA_INSTANCE_HOST }}
username: ${{ secrets.PAYARA_INSTANCE_USERNAME }}
key: ${{ secrets.PAYARA_INSTANCE_SSH_PRIVATE_KEY }}
host: ${{ secrets.BETA_PAYARA_INSTANCE_HOST }}
username: ${{ secrets.BETA_PAYARA_INSTANCE_USERNAME }}
key: ${{ secrets.BETA_PAYARA_INSTANCE_SSH_PRIVATE_KEY }}
script: |
APPLICATION_NAME=dataverse-frontend
APPLICATION_WAR_PATH=deployment/payara/target/$APPLICATION_NAME.war
ASADMIN='/usr/local/payara5/bin/asadmin --user admin'
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 /spa $APPLICATION_WAR_PATH
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
script: |
APPLICATION_NAME=dataverse-frontend
APPLICATION_WAR_PATH=deployment/payara/target/$APPLICATION_NAME.war
ASADMIN='/usr/local/payara5/bin/asadmin --user admin'
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

0 comments on commit dca9519

Please sign in to comment.