Files
computer-playbook/.github/workflows/test-deploy-universal.yml
T
dependabot[bot] adbe4da38f chore(deps): bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-01 01:32:09 +00:00

190 lines
5.9 KiB
YAML

name: "📦 Test: Deploy (universal)"
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
actions: write
env:
INFINITO_DEPLOY_TYPE: universal
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_github: ${{ steps.split.outputs.apps_github }}
apps_self_hosted: ${{ steps.split.outputs.apps_self_hosted }}
steps:
- uses: actions/checkout@v7
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: 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
- name: Split apps between GitHub-hosted and self-hosted runners
id: split
shell: bash
env:
APPS_JSON: ${{ steps.discover.outputs.apps }}
CI_SELF_HOSTED_RUNNER_COUNT: ${{ vars.CI_SELF_HOSTED_RUNNER_COUNT || '0' }}
run: bash scripts/github/split_runner_apps.sh
universal:
name: ✨ Deploy ${{ matrix.apps }}${{ matrix.variant && format(' [{0}]', matrix.variant) || '' }}
if: needs.discover.outputs.apps_github != '' && needs.discover.outputs.apps_github != '[]'
runs-on: ubuntu-latest
timeout-minutes: 360
needs: discover
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.discover.outputs.apps_github) }}
steps:
# Reclaim runner space before Docker pulls start. Deploy jobs otherwise
# compete with the default Ubuntu image payload for limited root space.
# Option rationale: docs/contributing/artefact/files/github/workflow.md
- 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@v7
# Replace the default ~4 GB runner swap with a larger file so transient
# memory spikes (e.g. peertube plugin install, issue #162) don't trip
# the host OOM-killer. Script picks / or /mnt based on live free space.
- 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 }}
variant: ${{ matrix.variant }}
ANSIBLE_LOG_PATH: /tmp/ansible-${{ matrix.apps }}.log
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 }})"
universal-self-hosted:
name: ✨ Deploy ${{ matrix.apps }}${{ matrix.variant && format(' [{0}]', matrix.variant) || '' }} (self-hosted)
if: needs.discover.outputs.apps_self_hosted != '' && needs.discover.outputs.apps_self_hosted != '[]'
runs-on: [self-hosted, linux]
timeout-minutes: 360
needs: discover
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.discover.outputs.apps_self_hosted) }}
steps:
- name: Fix workspace ownership
shell: bash
run: sudo chown -R "$(id -u):$(id -g)" "$GITHUB_WORKSPACE" 2>/dev/null || true
- uses: actions/checkout@v7
- name: Resolve repository owner
shell: bash
run: |
set -euo pipefail
echo "GITHUB_REPOSITORY_OWNER=$(scripts/meta/resolve/repository/owner.sh)" >> "$GITHUB_ENV"
- name: Deploy app
shell: bash
env:
apps: ${{ matrix.apps }}
variant: ${{ matrix.variant }}
INFINITO_TIMEOUT_MULTIPLIER: ${{ vars.INFINITO_TIMEOUT_MULTIPLIER || '1' }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/tests/deploy/ci/all.sh
- name: Dump runner state (on failure)
if: failure()
shell: bash
run: ./scripts/github/runner/dump_state.sh "post-deploy failure (${{ matrix.apps }})"