feat: service workflow deploy dispatch
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
# Deploys and restarts a single service or all services.
|
||||
#
|
||||
# Usage: ./.gitea/scripts/deploy-for-services.sh <service-name|all> <dev|prod>
|
||||
set -euo pipefail
|
||||
|
||||
SERVICE=${1:-}
|
||||
AGEBD_ENV=${2:-}
|
||||
|
||||
SCRIPT_DIR=$(dirname "$0")
|
||||
|
||||
if [ "${SERVICE}" = "all" ]; then
|
||||
SERVICES=$(ls -d services/*/ | xargs -n1 basename)
|
||||
else
|
||||
SERVICES=${SERVICE}
|
||||
fi
|
||||
|
||||
for SERVICE_NAME in ${SERVICES}; do
|
||||
"${SCRIPT_DIR}/deploy-service.sh" "${SERVICE_NAME}" "${AGEBD_ENV}" true
|
||||
done
|
||||
@@ -0,0 +1,27 @@
|
||||
name: Service
|
||||
|
||||
# Manually re-deploy (and restart) individual services, or all of them, in dev.
|
||||
# There is deliberately no prod option here - prod deploys go through the
|
||||
# normal push-to-main flow (see the 'Deploy' workflow), which requires review.
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
service:
|
||||
description: "Service name in lower case, or 'all' for every service"
|
||||
type: string
|
||||
required: true
|
||||
|
||||
env:
|
||||
UV_CACHE_DIR: /var/cache/uv
|
||||
UV_LINK_MODE: hardlink
|
||||
|
||||
jobs:
|
||||
deploy-dev:
|
||||
runs-on: hla-dev
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Deploy and restart ${{ inputs.service }}
|
||||
run: |
|
||||
./.gitea/scripts/deploy-for-services.sh "${{ inputs.service }}" "dev"
|
||||
Reference in New Issue
Block a user