44 workflow_dispatch :
55 inputs :
66 base_version :
7- description : Base image version tag (e.g. base-2026-02-09 )
7+ description : Base image version tag (e.g. base-2026-05-04 )
88 required : true
99 update_base_stable :
1010 description : Also move base-stable tag
2626 runs-on : ubuntu-latest
2727 timeout-minutes : 90
2828 steps :
29- - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
30- - uses : docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
31- - uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef
29+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
30+ - uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
31+ - uses : docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121
3232 with :
3333 registry : ghcr.io
3434 username : ${{ github.repository_owner }}
@@ -37,12 +37,15 @@ jobs:
3737 - name : Prepare base tags
3838 id : meta
3939 run : |
40- image="ghcr.io/${{ github.repository_owner }}/winebot-base"
40+ owner_lc="$(printf '%s' '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')"
41+ image="ghcr.io/${owner_lc}/winebot-base"
4142 version="${{ github.event.inputs.base_version }}"
4243 if [[ ! "$version" =~ ^[A-Za-z0-9._-]{1,128}$ ]]; then
4344 echo "Invalid base_version: $version" >&2
4445 exit 1
4546 fi
47+ echo "image=${image}" >> "$GITHUB_OUTPUT"
48+ echo "version=${version}" >> "$GITHUB_OUTPUT"
4649 {
4750 echo "tags<<EOF"
4851 echo "${image}:${version}"
@@ -53,13 +56,39 @@ jobs:
5356 echo "EOF"
5457 } >> "$GITHUB_OUTPUT"
5558
56- - name : Build & push base-runtime
59+ - name : Build base image for validation
60+ uses : docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f
61+ with :
62+ context : .
63+ file : docker/base.Dockerfile
64+ target : final
65+ load : true
66+ push : false
67+ tags : winebot-base:${{ steps.meta.outputs.version }}
68+ cache-from : type=gha
69+ cache-to : type=gha,mode=max
70+
71+ - name : Scan base image (Trivy)
72+ run : |
73+ mkdir -p "${GITHUB_WORKSPACE}/.cache/trivy"
74+ docker run --rm \
75+ -v /var/run/docker.sock:/var/run/docker.sock \
76+ -v "${GITHUB_WORKSPACE}/.cache/trivy:/root/.cache/trivy" \
77+ aquasec/trivy:0.65.0 image \
78+ --scanners vuln \
79+ --format table \
80+ --exit-code 1 \
81+ --ignore-unfixed \
82+ --severity CRITICAL,HIGH \
83+ "winebot-base:${{ steps.meta.outputs.version }}"
84+
85+ - name : Build & push base image
5786 id : build
58- uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
87+ uses : docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f
5988 with :
6089 context : .
61- file : docker/Dockerfile
62- target : base-ready
90+ file : docker/base. Dockerfile
91+ target : final
6392 push : true
6493 tags : ${{ steps.meta.outputs.tags }}
6594 cache-from : type=gha
@@ -68,14 +97,15 @@ jobs:
6897 sbom : true
6998
7099 - name : Install cosign
71- uses : sigstore/cosign-installer@430b6a704fe0c92f1b1261d84376a900f38d90ff
100+ uses : sigstore/cosign-installer@cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003
72101
73102 - name : Sign base digest
74103 env :
104+ IMAGE : ${{ steps.meta.outputs.image }}
75105 DIGEST : ${{ steps.build.outputs.digest }}
76106 run : |
77107 if [ -z "$DIGEST" ]; then
78108 echo "Missing base digest from build" >&2
79109 exit 1
80110 fi
81- cosign sign --yes "ghcr.io/${{ github.repository_owner }}/winebot-base @${DIGEST}"
111+ cosign sign --yes "${IMAGE} @${DIGEST}"
0 commit comments