Compare commits

...
2 Commits
Author SHA1 Message Date
Test dab2cd9e90 fix: resolve merge conflicts in CI workflow
CI / Test (pull_request) Successful in 2m11s
CI / Build & Push Image (pull_request) Skipped
Resolved conflicts between fix/registry-login-env and origin/main:
- Use single-line apt-get install
- Use simplified short SHA command
- Use 'Build and push image' step name from main

All registry login changes preserved (env vars approach).
2026-09-06 23:40:32 -07:00
rockandTest 0261ad141b fix: separate test and build-push jobs (#3)
CI / Test (push) Successful in 2m24s
CI / Build & Push Image (push) Failing after 1m7s
## Problem

Monolithic test-build-push job runs all steps sequentially, with conditionals for push only on main. This makes it hard to see what failed and doesn't clearly separate concerns.

## Fix

Split into two jobs:
- **test**: Runs on all branches + PRs (go mod, vet, test, build binary)
- **build-push**: Runs only on main push after test passes

Move env vars to workflow level (cleaner, reused by both jobs).

## Result
- PRs: test job runs  (no docker install, no registry push) 
- Main push: test → build-push → registry push 

---------

Co-authored-by: Test <[email protected]>
Reviewed-on: rock/poimen-workflows#3
2026-09-07 06:23:59 +00:00
+3 -7
View File
@@ -41,18 +41,14 @@ 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: |
SHORT_SHA=$(git rev-parse --short HEAD)
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Registry login
run: |
@@ -62,7 +58,7 @@ jobs:
REGISTRY_USER: ${{ secrets.FORGEJO_REGISTRY_USER }}
REGISTRY_TOKEN: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
- name: Build Docker image
- name: Build and push image
run: |
docker build --no-cache \
-t "${IMAGE}:${{ steps.sha.outputs.short_sha }}" \