mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 03:38:23 +00:00
Switch CI detection to GITHUB_ACTIONS and disable compose builds via INFINITO_NO_BUILD=1. The deploy workflows now rely on pulling the prebuilt CI image instead of triggering local Docker builds. - Remove legacy UP_BUILD handling - Enable --no-build in compose when running in real CI - Keep local/act builds working as before https://chatgpt.com/share/69666e0b-f08c-800f-93fd-611eced4b100
124 lines
2.8 KiB
YAML
124 lines
2.8 KiB
YAML
# .github/workflows/test-deploy-server.yml
|
|
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:
|
|
discover:
|
|
name: discover apps (arch)
|
|
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
|
|
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}"
|
|
|
|
server:
|
|
name: deploy:server (${{ matrix.app }})
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 240
|
|
needs: discover
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
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
|
|
|
|
normalize_bool() {
|
|
case "${1:-}" in
|
|
true|True|TRUE|1) echo "true" ;;
|
|
false|False|FALSE|0) echo "false" ;;
|
|
*) echo "true" ;;
|
|
esac
|
|
}
|
|
|
|
export MODE="server"
|
|
export DISTROS="${DISTROS}"
|
|
export MISSING_ONLY="$(normalize_bool "${MISSING_ONLY}")"
|
|
export KEEP_STACK="$(normalize_bool "${KEEP_STACK}")"
|
|
export APP="${{ matrix.app }}"
|
|
|
|
scripts/ci/deploy-one-app.sh
|
|
|
|
- name: Show last 200 log lines on failure
|
|
if: failure()
|
|
shell: bash
|
|
run: |
|
|
scripts/ci/log-tail.sh logs 200
|
|
|
|
|
|
- name: Upload deploy logs
|
|
if: ${{ always() && env.ACT != 'true' }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: deploy-logs-server-${{ matrix.app }}
|
|
path: logs/
|
|
if-no-files-found: warn
|
|
retention-days: 14
|