Files
YoyoNow cbb2987504 Only build and deploy changed projects in CI
Every project gets a checkAffected task that decides whether it has to
be rebuilt. A project is affected when one of these changed:
- its own files, or paths it adds with an affected { } block
- the versions of its resolved dependencies
- a project it depends on
- the root project, which owns the shared build and CI files

Projects list what they ship in a deploy { } block, and can add
afterDeploy commands there. Jars are now byte-reproducible. Only files
whose hash differs from the deployed one are uploaded, and only their
afterDeploy commands are run.

The deploy workflow diffs against the last deployed commit, which is
stored on the server with the dependency versions. PR builds diff
against the merge base. Shared setup steps moved into composite actions
under .gitea/actions.
2026-11-01 09:36:19 +01:00

52 lines
1.3 KiB
YAML

name: Setup SSH
description: Configures the deploy server as the SSH host "deploy" for ssh and scp
inputs:
host:
description: Deploy server host name
required: true
user:
description: Deploy server user
required: true
port:
description: Deploy server SSH port
required: false
default: '22'
key:
description: Private SSH key of the deploy user
required: true
runs:
using: composite
steps:
- name: Configure SSH
shell: bash
env:
DEPLOY_HOST: ${{ inputs.host }}
DEPLOY_USER: ${{ inputs.user }}
DEPLOY_PORT: ${{ inputs.port }}
DEPLOY_SSH_KEY: ${{ inputs.key }}
run: |
set -euo pipefail
: "${DEPLOY_HOST:?Missing DEPLOY_HOST secret}"
: "${DEPLOY_USER:?Missing DEPLOY_USER secret}"
: "${DEPLOY_SSH_KEY:?Missing DEPLOY_SSH_KEY secret}"
port="${DEPLOY_PORT:-22}"
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "$DEPLOY_SSH_KEY" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
ssh-keyscan -p "$port" "$DEPLOY_HOST" >> ~/.ssh/known_hosts
cat >> ~/.ssh/config <<EOF
Host deploy
HostName ${DEPLOY_HOST}
User ${DEPLOY_USER}
Port ${port}
IdentityFile ~/.ssh/deploy_key
EOF
chmod 600 ~/.ssh/config