Compare commits

..
Author SHA1 Message Date
Test b958da984c fix: standardize poimen-workflows CI to unified pattern
CI / Test (pull_request) Successful in 2m7s
CI / Build & Push Image (pull_request) Skipped
Unified pattern enforced:
- test job: runs on all branches + PRs
- build-push job: only on main push, depends on test
- Proper env vars (GOPRIVATE, REGISTRY, IMAGE)
- Install Node.js before checkout
- Install docker only in build-push
- Docker login + build + push + prune
2026-09-07 00:12:35 -07:00
rockandTest 45b7f8ca61 fix: use env vars for docker registry credentials (#4)
CI / Test (push) Successful in 2m7s
CI / Build & Push Image (push) Failing after 1m5s
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: Test <[email protected]>
Reviewed-on: rock/poimen-workflows#4
2026-09-07 06:48:25 +00:00
+7 -3
View File
@@ -41,14 +41,18 @@ jobs:
runs-on: golang
steps:
- name: Install Node.js and Docker
run: apt-get update && apt-get install -y nodejs docker.io
run: |
apt-get update
apt-get install -y nodejs docker.io
- name: Checkout code
uses: actions/checkout@v4
- name: Get short SHA
id: sha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
- name: Registry login
run: |
@@ -58,7 +62,7 @@ jobs:
REGISTRY_USER: ${{ secrets.FORGEJO_REGISTRY_USER }}
REGISTRY_TOKEN: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
- name: Build and push image
- name: Build Docker image
run: |
docker build --no-cache \
-t "${IMAGE}:${{ steps.sha.outputs.short_sha }}" \