Skip to content

Deploy DSpace

Deploy DSpace #980

Workflow file for this run

# DSpace Docker deploy on dataquest servers
name: Deploy DSpace
on:
workflow_call:
inputs:
INSTANCE:
required: false
type: string
default: '5'
IMPORT:
required: false
default: true
type: boolean
workflow_dispatch:
inputs:
INSTANCE:
required: true
default: '5'
type: choice
options:
- '*'
- '5'
- '8'
IMPORT:
required: true
default: true
type: boolean
jobs:
deploy:
if: github.event.inputs.INSTANCE == '*' || github.event.inputs.INSTANCE == '5'
runs-on: dspace-dep-1
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: deploy to dev-5
run: |
cd $GITHUB_WORKSPACE/build-scripts/run/
pwd
touch .env.dev-5 || true
echo INSTANCE=5 >> .env.dev-5
echo DSPACE_HOST=dev-5.pc >> .env.dev-5
echo DSPACE_VER=dspace-7_x >> .env.dev-5
echo DSPACE_SSL=false >> .env.dev-5
echo DOCKER_OWNER=dataquest >> .env.dev-5
echo DSPACE_UI_IMAGE=\${DOCKER_OWNER}/dspace-angular:\$DSPACE_VER >> .env.dev-5
echo DSPACE_REST_IMAGE=\${DOCKER_OWNER}/dspace:\$DSPACE_VER >> .env.dev-5
echo DSPACE_REST_PORT=8\$INSTANCE >> .env.dev-5
echo REST_URL=http://\${DSPACE_HOST}:\${DSPACE_REST_PORT}/server >> .env.dev-5
echo UI_URL=http://\${DSPACE_HOST}:\${DSPACE_REST_PORT} >> .env.dev-5
echo S3_STORAGE=0 >> .env.dev-5
echo S3_ENABLED=false >> .env.dev-5
echo S3_RELATIVE_PATH=true >> .env.dev-5
echo S3_BUCKET=dev-5-dspace >> .env.dev-5
echo S3_SUBFOLDER=seven-five >> .env.dev-5
echo S3_ACCESS=${{ secrets.AMAZON_ACCESS }} >> .env.dev-5
echo S3_SECRET=${{ secrets.AMAZON_SECRET }} >> .env.dev-5
echo S3_REGION_NAME=eu-central-1 >> .env.dev-5
export ENVFILE=$(pwd)/.env.dev-5
./start.sh dspace-5
deploy-8:
if: github.event.inputs.INSTANCE == '*' || github.event.inputs.INSTANCE == '8'
runs-on: dspace-dep-1
timeout-minutes: 120
env:
INSTANCE: '8'
ENVFILE: /opt/dspace-envs/.env.dspace.imported.dev-5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/erase-db
with:
INSTANCE: ${{ env.INSTANCE }}
NAME: dspace-${{ env.INSTANCE }}
- name: deploy dspace-import on dev-5
working-directory: build-scripts/run/
run: |
./start.sh dspace-$INSTANCE
/bin/bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://dev-5.pc:8$INSTANCE/server/api)" != "200" ]]; do sleep 5; done'
import-8:
runs-on: dspace-dep-1
if: github.event.inputs.IMPORT == 'true'
needs: deploy-8
env:
INSTANCE: '8'
ENVFILE: /opt/dspace-envs/.env.dspace.imported.dev-5
steps:
- uses: ./.github/actions/import-db
with:
INSTANCE: ${{ env.INSTANCE }}
DATADIR: /opt/dspace-data/clarin-dspace/