commit c062185c87e9300b9958f9dda37e2291046ea565
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2026-05-26T17:26:03Z |
| subject | Added ghcr image |
commit c062185c87e9300b9958f9dda37e2291046ea565
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2026-05-26T17:26:03Z
Added ghcr image
---
.github/workflows/cmake-multi-platform.yml | 51 ++++++++++++++++++++++++++++++
Dockerfile | 2 +-
2 files changed, 52 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml
index 5469424..cdbb1af 100644
--- a/.github/workflows/cmake-multi-platform.yml
+++ b/.github/workflows/cmake-multi-platform.yml
@@ -204,3 +204,54 @@ jobs:
--title "$tag" \
--generate-notes
fi
+
+ docker:
+ name: Docker image
+ runs-on: ubuntu-latest
+
+ if: startsWith(github.ref, 'refs/tags/v')
+
+ needs:
+ - linux-musl-x86_64
+ - linux-musl-arm64
+ - macos
+ - windows
+
+ permissions:
+ contents: read
+ packages: write
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set image name
+ run: |
+ image="ghcr.io/${GITHUB_REPOSITORY}"
+ echo "IMAGE_NAME=${image,,}" >> "$GITHUB_ENV"
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v4
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v4
+
+ - name: Login to GHCR
+ uses: docker/login-action@v4
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ github.token }}
+
+ - name: Build and push image
+ uses: docker/build-push-action@v7
+ with:
+ context: .
+ file: ./Dockerfile
+ platforms: linux/amd64,linux/arm64
+ push: true
+ tags: |
+ ${{ env.IMAGE_NAME }}:${{ github.ref_name }}
+ labels: |
+ org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
+ org.opencontainers.image.version=${{ github.ref_name }}
+ org.opencontainers.image.revision=${{ github.sha }}
diff --git a/Dockerfile b/Dockerfile
index 0fcf32c..e612879 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM --platform=$BUILDPLATFORM alpine:3.23 AS build
+FROM alpine:3.23 AS build
RUN --mount=type=cache,target=/var/cache/apk,sharing=locked \
apk add --update-cache build-base libevent-dev libevent-static