fix(gitea): ensure python runtime for deploy update job
Gitea Fast Deploy / Test Backend (push) Has been skipped
Gitea Fast Deploy / Build and Push Image (push) Successful in 2s
Gitea Fast Deploy / Update Deploy Repo (push) Successful in 6s
Gitea Fast Deploy / Fast Deploy Summary (push) Successful in 0s

This commit is contained in:
2026-02-28 23:14:32 +08:00
parent 45b7b1fecd
commit cb3f60ed11
+34
View File
@@ -236,6 +236,40 @@ jobs:
pr_url: ${{ steps.create_pr.outputs.pr_url }}
steps:
- name: Ensure Python runtime
shell: bash
run: |
set -euo pipefail
if command -v python3 >/dev/null 2>&1; then
:
elif command -v python >/dev/null 2>&1; then
ln -sf "$(command -v python)" /usr/local/bin/python3
elif command -v apk >/dev/null 2>&1; then
apk add --no-cache python3 py3-pip
elif command -v apt-get >/dev/null 2>&1; then
apt-get update
apt-get install -y python3 python3-pip
else
echo "No supported package manager found to install python3" >&2
exit 1
fi
if ! python3 -m pip --version >/dev/null 2>&1; then
if command -v apk >/dev/null 2>&1; then
apk add --no-cache py3-pip
elif command -v apt-get >/dev/null 2>&1; then
apt-get update
apt-get install -y python3-pip
else
echo "python3 exists but pip is unavailable" >&2
exit 1
fi
fi
python3 --version
python3 -m pip --version
- name: Install PyYAML
shell: bash
run: |