mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 11:46:35 +00:00
Use whale (🐳) for the per-app matrix job to mirror the swarm workflow's bee (🐝) pattern, and magnifying glass (🔍) for the discover step. Keep the workflow header on the existing 📦 prefix to stay consistent with the other test-deploy-* siblings. Rename the workflow file and align all references: - ci-orchestrator.yml job key + uses: path - artifact names: inventory-server-* -> inventory-compose-*, playwright-server-* -> playwright-compose-* - scripts/github/inventory/zip_compose_for_upload.sh output path - 3 docs files INFINITO_DEPLOY_TYPE: server stays - that key is wired to the invokable-rule registry in utils/roles/validation/invokable.py and is a separate refactor concern. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
170 lines
4.7 KiB
YAML
170 lines
4.7 KiB
YAML
name: "📦 Test: Deploy (compose)"
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
distros:
|
|
description: "Space-separated distro list"
|
|
required: true
|
|
type: string
|
|
whitelist:
|
|
description: "Optional space-separated whitelist of app ids"
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
|
|
env:
|
|
INFINITO_DEPLOY_TYPE: server
|
|
INFINITO_DISTROS: ${{ inputs.distros }}
|
|
NIX_CONFIG: |
|
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
|
INFINITO_IMAGE_TAG: ci-${{ github.sha }}
|
|
INFINITO_GHCR_MIRROR_PREFIX: mirror
|
|
INFINITO_PLAYWRIGHT_KEEP: ${{ vars.INFINITO_PLAYWRIGHT_KEEP }}
|
|
INFINITO_APP_DISCOVERY_RUNNER: host
|
|
jobs:
|
|
discover:
|
|
name: 🔍 Discover apps
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
outputs:
|
|
apps: ${{ steps.discover.outputs.apps }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: 🔍 Resolve repository owner
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
echo "GITHUB_REPOSITORY_OWNER=$(scripts/meta/resolve/repository/owner.sh)" >> "$GITHUB_ENV"
|
|
|
|
- name: 📦 Install jq
|
|
shell: bash
|
|
run: ./scripts/install/apt.sh jq
|
|
|
|
- name: Install deps (jq + envsubst)
|
|
shell: bash
|
|
run: ./scripts/install/apt.sh jq gettext-base
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.12"
|
|
cache: pip
|
|
cache-dependency-path: pyproject.toml
|
|
|
|
- name: Install project (host venv)
|
|
shell: bash
|
|
run: make install
|
|
|
|
- name: Resolve effective whitelist (diff vs origin/main)
|
|
id: resolve_wl
|
|
shell: bash
|
|
env:
|
|
INPUT_WHITELIST: ${{ inputs.whitelist }}
|
|
run: ./scripts/github/resolve/effective_whitelist.sh
|
|
|
|
- name: Discover apps
|
|
id: discover
|
|
shell: bash
|
|
env:
|
|
INFINITO_WHITELIST: ${{ steps.resolve_wl.outputs.whitelist }}
|
|
run: ./scripts/github/resolve/output_apps.sh
|
|
|
|
compose:
|
|
name: 🐳 Compose ${{ matrix.apps }}
|
|
if: needs.discover.outputs.apps != '' && needs.discover.outputs.apps != '[]'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 360
|
|
needs: discover
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
apps: ${{ fromJson(needs.discover.outputs.apps) }}
|
|
|
|
steps:
|
|
- name: 🧹 Free disk space
|
|
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
|
|
with:
|
|
tool-cache: true
|
|
android: true
|
|
dotnet: true
|
|
haskell: true
|
|
large-packages: true
|
|
docker-images: true
|
|
swap-storage: true
|
|
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: 💾 Enlarge swap space
|
|
shell: bash
|
|
run: ./scripts/github/runner/enlarge_swap.sh
|
|
|
|
- name: 🔍 Resolve repository owner
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
echo "GITHUB_REPOSITORY_OWNER=$(scripts/meta/resolve/repository/owner.sh)" >> "$GITHUB_ENV"
|
|
|
|
- name: 📦 Install jq
|
|
shell: bash
|
|
run: ./scripts/install/apt.sh jq
|
|
|
|
- name: 🚀 Deploy app
|
|
shell: bash
|
|
env:
|
|
apps: ${{ matrix.apps }}
|
|
ANSIBLE_LOG_PATH: /tmp/ansible-${{ matrix.apps }}.log
|
|
run: ./scripts/tests/deploy/ci/all.sh
|
|
|
|
- name: 📊 Role runtimes
|
|
if: always()
|
|
shell: bash
|
|
run: python3 utils/github/profile/role_summary.py /tmp/ansible-${{ matrix.apps }}.log
|
|
|
|
- name: 🩺 Dump runner state (on failure)
|
|
if: failure()
|
|
shell: bash
|
|
run: ./scripts/github/runner/dump_state.sh "post-deploy failure (${{ matrix.apps }})"
|
|
|
|
- name: Playwright step summary
|
|
if: always()
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
python3 utils/github/playwright_summary.py \
|
|
/tmp/playwright-artifacts \
|
|
"${{ matrix.apps }}" \
|
|
>> "$GITHUB_STEP_SUMMARY"
|
|
|
|
- name: Upload Playwright artifacts
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: playwright-compose-${{ matrix.apps }}
|
|
path: /tmp/playwright-artifacts/
|
|
if-no-files-found: ignore
|
|
|
|
- name: Zip generated inventory for debugging
|
|
if: always()
|
|
shell: bash
|
|
env:
|
|
APP_ID: ${{ matrix.apps }}
|
|
run: bash scripts/github/inventory/zip_compose_for_upload.sh
|
|
|
|
- name: Upload inventory artifact
|
|
if: ${{ always() && !env.ACT }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: inventory-compose-${{ matrix.apps }}
|
|
path: /tmp/inventory-compose-${{ matrix.apps }}.zip
|
|
if-no-files-found: ignore
|