gitea fixes
All checks were successful
Debug job network / debug (push) Successful in 2s
Deploy to VPS / deploy (push) Successful in 53s

This commit is contained in:
Mykhailo Svishchov
2026-03-07 20:38:06 +02:00
parent 8ce0f47258
commit 01dd290b2e
2 changed files with 14 additions and 1 deletions

View File

@@ -13,8 +13,17 @@ jobs:
VPS_HOST: ${{ secrets.DEPLOY_VPS_HOST }}
VPS_USER: ${{ secrets.DEPLOY_VPS_USER }}
steps:
# Manual checkout: job container cannot resolve 'server', so clone via host IP (gateway).
# Set secret GITEA_HOST_IP to your runner host's gateway (from job: ip route show default | awk '{print $3}').
- name: Checkout
uses: actions/checkout@v4
run: |
GITEA_HOST="${GITEA_HOST_IP:-172.20.0.1}"
git clone --depth 1 "http://oauth2:${GITHUB_TOKEN}@${GITEA_HOST}:3000/admin/honey-be.git" .
git fetch --depth 1 origin "${{ github.sha }}"
git checkout -q "${{ github.sha }}"
env:
GITHUB_TOKEN: ${{ github.token }}
GITEA_HOST_IP: ${{ secrets.GITEA_HOST_IP }}
- name: Install SSH and Rsync
run: |

View File

@@ -135,6 +135,7 @@ Optional secrets (workflow has defaults):
|------|--------|-------------|
| `DEPLOY_VPS_HOST` | `188.116.23.7` | Only if your Staged VPS has a different IP. |
| `DEPLOY_VPS_USER` | `root` | Only if the deploy user is not `root`. |
| `GITEA_HOST_IP` | e.g. `172.20.0.1` | If checkout fails with "Could not resolve host: server", set this to the **default gateway** seen from the job container. Run a debug job that runs `ip route show default \| awk '{print $3}'` and use that value. The workflow defaults to `172.20.0.1` if unset. |
---
@@ -292,6 +293,9 @@ git push origin main
## Troubleshooting
- **Could not resolve host: server** (during checkout)
The deploy workflow uses a manual clone via the runner host IP. Set repository secret `GITEA_HOST_IP` to the default gateway as seen from the job container (e.g. run a debug job with `ip route show default | awk '{print $3}'` and use that value, often `172.20.0.1` or `172.17.0.1`). The workflow defaults to `172.20.0.1` if the secret is not set.
- **Permission denied (publickey)**
Check: public key in `authorized_keys` on VPS, private key in `DEPLOY_SSH_PRIVATE_KEY`, no extra spaces/newlines when pasting.