fix: remove container override, use actions/checkout@v4, proper docker install
CI / test-build-push (pull_request) Successful in 2m24s
CI / test-build-push (pull_request) Successful in 2m24s
Container override breaks docker socket access to dind sidecar. Changes: - Remove 'container: image: golang:1.26' (breaks dind socket) - 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).
This commit is contained in:
@@ -8,28 +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: Install Node.js and Docker for actions runtime
|
- name: Install Node.js for actions runtime
|
||||||
run: apt-get update && apt-get install -y nodejs docker.io
|
run: apt-get update && apt-get install -y nodejs
|
||||||
|
|
||||||
- name: Configure git authentication
|
|
||||||
run: |
|
|
||||||
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
|
||||||
@@ -47,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: |
|
||||||
|
|||||||
Reference in New Issue
Block a user