mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-12-05 09:18:53 +00:00
ci(deploy): split per-app deploy into server/workstation/rest workflows (env-only defaults)
- Remove _deploy-per-app.yml (inputs-based indirection) - Add dedicated workflows: - test-deploy-server.yml - test-deploy-workstation.yml - test-deploy-universal.yml (rest) - Configure via env defaults only (KISS / SRP / SPOT) - Update Makefile to target the new workflows and pass overrides via env - Ensure deploy-one-app.sh is executable - Keep failure debug (last 200 chars) and upload logs only outside act
This commit is contained in:
7 files changed
+306
-268
No files matched your search
@@ -2,9 +2,106 @@ name: Test Infinito.Nexus Deploy (server)
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
|
||||
env:
|
||||
# KISS: configure via env only
|
||||
MODE: server
|
||||
DISTROS: "arch debian ubuntu fedora centos"
|
||||
ONLY_APP: ""
|
||||
MISSING_ONLY: "true"
|
||||
KEEP_STACK: "true"
|
||||
NIX_CONFIG: |
|
||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
jobs:
|
||||
server:
|
||||
uses: ./.github/workflows/_deploy-per-app.yml
|
||||
with:
|
||||
mode: server
|
||||
name: deploy:server (per app, all distros)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 240
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install jq
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y jq
|
||||
|
||||
- name: Start stack for discovery (arch)
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
export INFINITO_DISTRO="arch"
|
||||
make up
|
||||
|
||||
- name: Discover apps (JSON)
|
||||
id: discover
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
apps="$(MODE="${MODE}" scripts/ci/discover.sh)"
|
||||
[[ -n "${apps}" ]] || apps='[]'
|
||||
|
||||
if [[ -n "${ONLY_APP}" ]]; then
|
||||
apps="$(jq -nc --arg a "${ONLY_APP}" '[ $a ]')"
|
||||
fi
|
||||
|
||||
echo "apps=${apps}" >> "$GITHUB_OUTPUT"
|
||||
echo "apps_json=${apps}"
|
||||
|
||||
- name: Deploy each app (matrix via bash loop)
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
normalize_bool() {
|
||||
case "${1:-}" in
|
||||
true|True|TRUE|1) echo "true" ;;
|
||||
false|False|FALSE|0) echo "false" ;;
|
||||
*) echo "true" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
apps_json='${{ steps.discover.outputs.apps }}'
|
||||
readarray -t apps < <(echo "${apps_json}" | jq -r '.[]')
|
||||
|
||||
export MODE="server"
|
||||
export DISTROS="${DISTROS}"
|
||||
export MISSING_ONLY="$(normalize_bool "${MISSING_ONLY}")"
|
||||
export KEEP_STACK="$(normalize_bool "${KEEP_STACK}")"
|
||||
|
||||
for app in "${apps[@]}"; do
|
||||
export APP="${app}"
|
||||
scripts/ci/deploy-one-app.sh
|
||||
done
|
||||
|
||||
- name: Show last 200 chars on failure
|
||||
if: failure()
|
||||
shell: bash
|
||||
run: |
|
||||
echo "=== DEBUG: logs ==="
|
||||
ls -la logs || true
|
||||
echo
|
||||
|
||||
shopt -s nullglob
|
||||
for f in logs/*.log; do
|
||||
echo "=== tail -c 200 $f ==="
|
||||
tail -c 200 "$f" || true
|
||||
echo
|
||||
done
|
||||
|
||||
- name: Upload deploy logs
|
||||
if: ${{ always() && env.ACT != 'true' }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: deploy-logs-server
|
||||
path: logs/
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
Reference in new issue
Block a user