fix: CI workflow - remove container override, use actions/checkout@v4 (#2)
CI / test-build-push (push) Failing after 3m3s

Container override breaks docker socket access to dind sidecar.

Changes:
- Remove 'container: image: golang:1.26' (breaks dind socket access)
- Remove manual git config/checkout, use actions/checkout@v4
- Move docker.io install to conditional step before docker login
- Install Node.js for actions runtime

This workflow now works with the new runner setup (golang:1.26-bookworm label image with shared docker socket via dind sidecar). Resolves issues with docker build/push failing in CI.

---------

Co-authored-by: Test <[email protected]>
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
2026-09-07 05:48:24 +00:00
co-authored by Test
parent e81bfbc98d
commit 3452c6fca7
+7 -12
View File
@@ -8,25 +8,16 @@ on:
jobs: jobs:
test-build-push: test-build-push:
runs-on: golang runs-on: golang
container:
image: golang:1.26
env: env:
GOPRIVATE: forgejo.riotpiao.com GOPRIVATE: forgejo.riotpiao.com
REGISTRY: forgejo.riotpiao.com REGISTRY: forgejo.riotpiao.com
IMAGE: forgejo.riotpiao.com/rock/poimen-workflows IMAGE: forgejo.riotpiao.com/rock/poimen-workflows
steps: steps:
- name: Configure git authentication - name: Install Node.js for actions runtime
run: | run: apt-get update && apt-get install -y nodejs
git config --global url."https://oauth2:${{ secrets.REGISTRY_PAT }}@forgejo.riotpiao.com".insteadOf "https://forgejo.riotpiao.com"
git config --global credential.helper store
echo "https://oauth2:${{ secrets.REGISTRY_PAT }}@forgejo.riotpiao.com" >> ~/.git-credentials
- name: Checkout code - name: Checkout code
run: | uses: actions/checkout@v4
git init
git remote add origin https://forgejo.riotpiao.com/rock/poimen-workflows.git
git fetch origin ${{ github.head_ref || github.ref_name }} --depth=1
git checkout FETCH_HEAD
- name: Download dependencies - name: Download dependencies
run: go mod download run: go mod download
@@ -44,6 +35,10 @@ jobs:
id: sha id: sha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Install Docker CLI
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: apt-get update && apt-get install -y docker.io
- name: Registry login - name: Registry login
if: github.ref == 'refs/heads/main' && github.event_name == 'push' if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: | run: |