mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-12-05 17:28:21 +00:00
ci(local): add serial test-deploy-local workflow and wire Makefile targets
- Add new test-deploy-local.yml workflow for local act runs - Uses env-based configuration (TEST_DEPLOY_TYPE, DISTROS, ONLY_APP) - Enforces serial execution via strategy.max-parallel: 1 - Supports optional workflow_dispatch inputs for GitHub UI - Refactor Makefile deploy targets - Move distro variables to top-level section - Add local act-based deploy flow using test-deploy-local.yml - Keep CI deploy flow via workflow_dispatch event payload - Remove deprecated rapid deploy path This enables reliable, non-parallel local deploy testing with act while keeping CI deploy workflows unchanged. https://chatgpt.com/share/69692ef1-095c-800f-83cb-924fadfaa554
This commit is contained in:
2 files changed
+135
-29
No files matched your search
@@ -0,0 +1,118 @@
|
||||
name: Test Infinito.Nexus Deploy (local)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
test_deploy_type:
|
||||
description: "server | universal | workstation"
|
||||
required: false
|
||||
default: "server"
|
||||
type: string
|
||||
distros:
|
||||
description: "Space-separated distro list"
|
||||
required: false
|
||||
default: "arch"
|
||||
type: string
|
||||
only_app:
|
||||
description: "Optional single app id"
|
||||
required: false
|
||||
default: ""
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
|
||||
# IMPORTANT:
|
||||
# - For local `act`, prefer overriding via `--env`.
|
||||
# - For GitHub UI dispatch, inputs are used as fallback.
|
||||
env:
|
||||
TEST_DEPLOY_TYPE: "server"
|
||||
DISTROS: "arch"
|
||||
ONLY_APP: ""
|
||||
NIX_CONFIG: ""
|
||||
INFINITO_IMAGE_TAG: "latest"
|
||||
jobs:
|
||||
discover:
|
||||
name: discover apps (local)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
outputs:
|
||||
apps: ${{ steps.discover.outputs.apps }}
|
||||
|
||||
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
|
||||
make up
|
||||
|
||||
- name: Discover apps (JSON)
|
||||
id: discover
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
echo "TEST_DEPLOY_TYPE=${TEST_DEPLOY_TYPE}"
|
||||
echo "DISTROS=${DISTROS}"
|
||||
echo "ONLY_APP=${ONLY_APP}"
|
||||
|
||||
apps="$(make ci-deploy-discover)"
|
||||
[[ -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}"
|
||||
|
||||
local:
|
||||
name: deploy:local (${{ matrix.app }})
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 240
|
||||
needs: discover
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
app: ${{ fromJson(needs.discover.outputs.apps) }}
|
||||
|
||||
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 (arch)
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
make up
|
||||
|
||||
- name: Deploy app
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
export APP="${{ matrix.app }}"
|
||||
# TEST_DEPLOY_TYPE/DISTROS/ONLY_APP are already in env
|
||||
make ci-deploy-app
|
||||
|
||||
- name: Show last 200 log lines on failure
|
||||
if: failure()
|
||||
shell: bash
|
||||
run: |
|
||||
scripts/ci/log-tail.sh logs 200
|
||||
Reference in new issue
Block a user