Author SHA1 Message Date
rockandAdmin Bot 736c0d7724 fix: use env vars for docker registry credentials (#2)
CI / Test (push) Successful in 1m51s
CI / Build & Push Image (push) Failing after 1m6s
Fix registry login by passing FORGEJO_REGISTRY_USER and FORGEJO_REGISTRY_TOKEN via environment variables instead of direct secret interpolation.

Uses the proven pattern from riotpiao.com reference commit.

This prevents credentials from being exposed in logs or shell history while keeping the standard docker login approach.

After merge + org-level secrets configured:
- All repos inherit FORGEJO_REGISTRY_USER and FORGEJO_REGISTRY_TOKEN
- CI validates credentials exist before docker login
- Image pushed to registry on main push

---------

Co-authored-by: Admin Bot <[email protected]>
Reviewed-on: #2
2026-09-07 06:50:48 +00:00
+4 -6
View File
@@ -24,11 +24,8 @@ jobs:
- name: Go vet
run: go vet ./...
- name: Go test -race
run: go test ./... -race
- name: Static build (smoke)
run: CGO_ENABLED=0 go build -trimpath -o gateway ./cmd/gateway
- name: Go test
run: go test ./...
build-push:
name: Build & Push Image
@@ -39,7 +36,7 @@ jobs:
- name: Install Node.js and Docker
run: |
apt-get update
apt-get install -y --no-install-recommends nodejs docker.io git
apt-get install -y nodejs docker.io
- name: Checkout code
uses: actions/checkout@v4
@@ -63,6 +60,7 @@ jobs:
docker build --no-cache \
-t "${IMAGE}:${{ steps.sha.outputs.short_sha }}" \
-t "${IMAGE}:latest" \
-f Dockerfile \
.
- name: Push Docker image