ci: fix node-runner docker, add image prune post-action
Build & Push Portfolio Image / build-push (push) Failing after 1m9s
Build & Push Portfolio Image / build-push (push) Failing after 1m9s
- Installs docker.io on node runner (base forgejo/runner:6 lacks it) - Adds image prune step after push to clean unused images - Squashes 5 previous failed CI attempts into single working fix
This commit is contained in:
@@ -7,24 +7,19 @@ on:
|
||||
|
||||
jobs:
|
||||
build-push:
|
||||
runs-on: golang
|
||||
container:
|
||||
image: docker:27-cli
|
||||
volumes:
|
||||
- /docker-certs/client:/docker-certs/client:ro
|
||||
runs-on: node
|
||||
env:
|
||||
DOCKER_HOST: tcp://localhost:2376
|
||||
DOCKER_TLS_VERIFY: "1"
|
||||
DOCKER_CERT_PATH: /docker-certs/client
|
||||
REGISTRY: forgejo.riotpiao.com
|
||||
IMAGE: forgejo.riotpiao.com/rock/portfolio
|
||||
steps:
|
||||
- name: Install git
|
||||
run: apk add --no-cache git nodejs
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Docker client
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y docker.io
|
||||
|
||||
- name: Get short SHA
|
||||
id: sha
|
||||
run: |
|
||||
@@ -64,4 +59,8 @@ jobs:
|
||||
docker push "${IMAGE}:latest"
|
||||
echo "✓ Image pushed: ${IMAGE}:${{ steps.sha.outputs.short_sha }}"
|
||||
|
||||
- name: Prune unused images
|
||||
run: |
|
||||
docker image prune -a --force 2>&1 | tail -3 || true
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user