Remove Actions deploy SSH fetch
Homelab Main / deploy (push) Failing after 20s
Details
Homelab Main / deploy (push) Failing after 20s
Details
This commit is contained in:
parent
11021138d7
commit
0a53f6bc20
|
|
@ -123,26 +123,36 @@ jobs:
|
|||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
gitea_ssh_url="${GITEA_SSH_URL:-ssh://git@192.168.100.89:32222/jv/my-homelab-configs.git}"
|
||||
gitea_ssh_command="${GITEA_SSH_COMMAND:-ssh -i /home/jv/.ssh/id_ed25519 -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new}"
|
||||
deploy_dir="${HOMELAB_DEPLOY_DIR:-/home/jv/my-homelab-configs}"
|
||||
|
||||
if [[ ! -d "${deploy_dir}/.git" ]]; then
|
||||
echo "Persistent deploy checkout ${deploy_dir} was not found; using Actions workspace ${PWD}."
|
||||
deploy_dir="${PWD}"
|
||||
workspace_dir="${PWD}"
|
||||
deploy_dir="${HOMELAB_DEPLOY_DIR:-}"
|
||||
if [[ -z "${deploy_dir}" ]]; then
|
||||
for candidate in /home/jv/my-homelab-configs /home/jv/repos/my-homelab-configs "${workspace_dir}"; do
|
||||
if [[ -d "${candidate}/.git" ]]; then
|
||||
deploy_dir="${candidate}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [[ ! -d "${deploy_dir}/.git" ]]; then
|
||||
echo "Deploy checkout ${deploy_dir} is not a Git repository." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ "${deploy_dir}" != "${workspace_dir}" ]]; then
|
||||
echo "Persistent deploy checkout: ${deploy_dir}"
|
||||
git -C "${deploy_dir}" fetch "${workspace_dir}" HEAD
|
||||
git -C "${deploy_dir}" checkout -B main FETCH_HEAD
|
||||
git -C "${deploy_dir}" reset --hard FETCH_HEAD
|
||||
else
|
||||
echo "Deploy checkout: ${deploy_dir}"
|
||||
git -C "${deploy_dir}" checkout -B main HEAD
|
||||
git -C "${deploy_dir}" reset --hard HEAD
|
||||
fi
|
||||
|
||||
git -C "${deploy_dir}" remote set-url gitea "${gitea_ssh_url}" || \
|
||||
git -C "${deploy_dir}" remote add gitea "${gitea_ssh_url}"
|
||||
GIT_SSH_COMMAND="${gitea_ssh_command}" git -C "${deploy_dir}" fetch gitea main
|
||||
git -C "${deploy_dir}" checkout -B main "${{ gitea.sha }}"
|
||||
git -C "${deploy_dir}" remote set-url local-bootstrap /home/jv/git-server/my-homelab-configs.git || \
|
||||
if git -C "${deploy_dir}" remote get-url local-bootstrap >/dev/null 2>&1; then
|
||||
git -C "${deploy_dir}" remote set-url local-bootstrap /home/jv/git-server/my-homelab-configs.git
|
||||
else
|
||||
git -C "${deploy_dir}" remote add local-bootstrap /home/jv/git-server/my-homelab-configs.git
|
||||
fi
|
||||
git -C "${deploy_dir}" push local-bootstrap HEAD:main
|
||||
|
||||
"${deploy_dir}/lab.sh" apps
|
||||
|
|
|
|||
|
|
@ -431,9 +431,11 @@ with the Gitea repository and switches the Debian working copy's `gitea` remote
|
|||
to `ssh://git@192.168.100.89:32222/jv/my-homelab-configs.git`. The default key
|
||||
is `/home/jv/.ssh/id_ed25519.pub`; set `LAB_GITEA_REPO_SSH_KEY_PATH` to use a
|
||||
different Debian-host key, or `LAB_GITEA_REPO_SSH_BOOTSTRAP=false` to leave SSH
|
||||
access unchanged. The Actions deploy job fetches the persistent Debian checkout
|
||||
through that SSH endpoint when `HOMELAB_DEPLOY_DIR` exists, and otherwise falls
|
||||
back to the checked-out Actions workspace.
|
||||
access unchanged. The Actions deploy job uses the checked-out Actions workspace
|
||||
as the source commit, updates the first available persistent checkout from
|
||||
`HOMELAB_DEPLOY_DIR`, `/home/jv/my-homelab-configs`, or
|
||||
`/home/jv/repos/my-homelab-configs`, and otherwise deploys directly from the
|
||||
Actions workspace. It does not need SSH read access back to Gitea.
|
||||
|
||||
Enable Actions for the repository in Gitea, then create a repository-level runner
|
||||
token from:
|
||||
|
|
|
|||
Loading…
Reference in New Issue