build fix 11
This commit is contained in:
@@ -14,7 +14,7 @@ env:
|
|||||||
# TODO: Remove after installing internal CA certificate on the runner
|
# TODO: Remove after installing internal CA certificate on the runner
|
||||||
GIT_SSL_NO_VERIFY: "true"
|
GIT_SSL_NO_VERIFY: "true"
|
||||||
REGISTRY_HOST: 192.168.3.80
|
REGISTRY_HOST: 192.168.3.80
|
||||||
DEPLOY_REGISTRY_HOST: 10.0.0.4
|
DEPLOY_REGISTRY_HOST: 10.0.0.4:5000
|
||||||
DEPLOY_SSH_HOST: 10.0.0.1
|
DEPLOY_SSH_HOST: 10.0.0.1
|
||||||
DOCKERFILE_PATH: Dockerfile.production
|
DOCKERFILE_PATH: Dockerfile.production
|
||||||
DOCKER_PLATFORM: linux/amd64
|
DOCKER_PLATFORM: linux/amd64
|
||||||
@@ -74,8 +74,8 @@ jobs:
|
|||||||
REPO="${{ gitea.repository }}"
|
REPO="${{ gitea.repository }}"
|
||||||
TAG="${{ gitea.sha }}"
|
TAG="${{ gitea.sha }}"
|
||||||
echo "repository=${REPO}" >> "$GITHUB_OUTPUT"
|
echo "repository=${REPO}" >> "$GITHUB_OUTPUT"
|
||||||
echo "full=${REGISTRY_HOST}/${REPO}:${TAG}" >> "$GITHUB_OUTPUT"
|
echo "full=${DEPLOY_REGISTRY_HOST}/${REPO}:${TAG}" >> "$GITHUB_OUTPUT"
|
||||||
echo "latest=${REGISTRY_HOST}/${REPO}:latest" >> "$GITHUB_OUTPUT"
|
echo "latest=${DEPLOY_REGISTRY_HOST}/${REPO}:latest" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Check Docker registry credentials
|
- name: Check Docker registry credentials
|
||||||
id: registry-check
|
id: registry-check
|
||||||
@@ -267,7 +267,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ '$PUSH_IMAGE' = 'true' ]; then
|
if [ '$PUSH_IMAGE' = 'true' ]; then
|
||||||
printf '%s' '$REGISTRY_PASSWORD_B64' | base64 -d | docker login '$REGISTRY_HOST' \
|
printf '%s' '$REGISTRY_PASSWORD_B64' | base64 -d | docker login '$DEPLOY_REGISTRY_HOST' \
|
||||||
--username '$REGISTRY_USERNAME' \
|
--username '$REGISTRY_USERNAME' \
|
||||||
--password-stdin
|
--password-stdin
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -407,6 +407,21 @@ Expected response:
|
|||||||
HTTP/1.1 401 Unauthorized
|
HTTP/1.1 401 Unauthorized
|
||||||
```
|
```
|
||||||
|
|
||||||
|
When CI builds on the VPS and pushes directly to the local registry, `DEPLOY_REGISTRY_HOST` in `.gitea/workflows/build-and-deploy.yml` must include the registry port, for example `10.0.0.4:5000`. Because the local registry is plain HTTP, configure the VPS Docker daemon once:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"insecure-registries": ["10.0.0.4:5000"]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
If `/etc/docker/daemon.json` already exists, merge the `insecure-registries` value with the existing JSON instead of replacing the file. Then restart Docker:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo systemctl restart docker
|
||||||
|
docker login 10.0.0.4:5000
|
||||||
|
```
|
||||||
|
|
||||||
Then on the VPS restart Traefik:
|
Then on the VPS restart Traefik:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Reference in New Issue
Block a user