Add containerized staging deployment
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
name: Export staging ISAC data
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: shd-build-staging
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
export:
|
||||
runs-on: stage-deploy
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Export canonical ISAC data and uploaded icons
|
||||
env:
|
||||
CONFIGURED_DEPLOY_PATH: ${{ vars.STAGE_DEPLOY_PATH }}
|
||||
run: |
|
||||
set -eu
|
||||
deployment_path="${CONFIGURED_DEPLOY_PATH:-/opt/shd-build-stage}"
|
||||
compose_file="$deployment_path/compose.staging.yml"
|
||||
deploy_environment="$deployment_path/.env.deploy"
|
||||
compose() {
|
||||
docker compose --env-file "$deploy_environment" -f "$compose_file" "$@"
|
||||
}
|
||||
restart_services() {
|
||||
compose up -d --no-build app scheduler
|
||||
}
|
||||
trap restart_services EXIT
|
||||
snapshot_name="isac-stage-${GITHUB_RUN_ID}.json"
|
||||
compose stop scheduler app
|
||||
compose run --rm --no-deps app node scripts/isac-data-export.mjs "/app/data/exports/$snapshot_name"
|
||||
compose run --rm --no-deps -v "$GITHUB_WORKSPACE:/export" app \
|
||||
cp "/app/data/exports/$snapshot_name" /export/isac-stage.json
|
||||
|
||||
- name: Publish ISAC snapshot
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: shd-stage-isac-data
|
||||
path: isac-stage.json
|
||||
retention-days: 14
|
||||
Reference in New Issue
Block a user