- Remove docker-ce and containerd.io (only CLI needed), wget, and npm - Replace npm with nodejs (runtime only, for Forgejo Actions compatibility) - Merge APT layers into single RUN to eliminate intermediate cache layers - Pin Ubuntu base by digest, Bun to v1.3.11, add Go SHA256 verification - Add registry-based build cache (cache-from/cache-to) to all workflows - Pass OCI labels from metadata-action to build-push-action - Add OCI labels to all Dockerfiles
47 lines
1.7 KiB
YAML
47 lines
1.7 KiB
YAML
name: ci-base
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'images/ci-base/**'
|
|
- '.forgejo/workflows/ci-base.yaml'
|
|
tags: ['*']
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
container:
|
|
image: data.forgejo.org/oci/node:20-bookworm
|
|
steps:
|
|
- name: Install Docker CLI
|
|
run: |
|
|
curl -fsSL https://download.docker.com/linux/static/stable/$(uname -m)/docker-27.5.1.tgz | tar xz
|
|
mv docker/docker /usr/local/bin/
|
|
rm -rf docker
|
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
- uses: https://code.forgejo.org/docker/setup-buildx-action@v4
|
|
- uses: https://code.forgejo.org/docker/login-action@v4
|
|
with:
|
|
registry: git.nakama.town
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.FORGEJO_TOKEN }}
|
|
- uses: https://code.forgejo.org/docker/metadata-action@v6
|
|
id: meta
|
|
with:
|
|
images: git.nakama.town/fmartingr/ci-images/ci-base
|
|
tags: |
|
|
type=raw,value=latest,enable={{is_default_branch}}
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
- uses: https://code.forgejo.org/docker/build-push-action@v7
|
|
with:
|
|
context: images/ci-base
|
|
file: images/ci-base/Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=registry,ref=git.nakama.town/fmartingr/ci-images/ci-base:buildcache
|
|
cache-to: type=registry,ref=git.nakama.town/fmartingr/ci-images/ci-base:buildcache,mode=max
|