mirror of
https://github.com/nickrunning/wechat-selkies.git
synced 2026-05-09 00:24:09 +00:00
feat: support minimal image variant with WeChat only (#92)
Add INSTALL_QQ and INSTALL_PCMANFM build args to conditionally skip QQ and file manager installation. CI builds both :latest (full) and :minimal (WeChat only) tags for each release.
This commit is contained in:
56
.github/workflows/docker.yml
vendored
56
.github/workflows/docker.yml
vendored
@@ -70,6 +70,37 @@ jobs:
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Extract metadata for minimal image
|
||||
id: meta-minimal
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
ghcr.io/${{ github.repository }}
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }},enable=${{ vars.ENABLE_DOCKERHUB == 'true' }}
|
||||
flavor: |
|
||||
latest=false
|
||||
suffix=-minimal
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=raw,value=minimal,enable=${{ github.ref == format('refs/heads/{0}', 'master') || startsWith(github.ref, 'refs/tags/') }}
|
||||
|
||||
- name: Build and push minimal Docker image
|
||||
id: build-minimal
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta-minimal.outputs.tags }}
|
||||
labels: ${{ steps.meta-minimal.outputs.labels }}
|
||||
build-args: |
|
||||
INSTALL_QQ=false
|
||||
INSTALL_PCMANFM=false
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Generate artifact attestation
|
||||
if: github.event_name != 'workflow_dispatch'
|
||||
uses: actions/attest-build-provenance@v1
|
||||
@@ -84,11 +115,16 @@ jobs:
|
||||
echo "### GitHub Container Registry" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Registry:** ${{ env.REGISTRY }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Repository:** ${{ env.IMAGE_NAME }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Digest:** \`${{ steps.build-image.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Tags:**" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Full image digest:** \`${{ steps.build-image.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Minimal image digest:** \`${{ steps.build-minimal.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Tags (full):**" >> $GITHUB_STEP_SUMMARY
|
||||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
||||
echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Tags (minimal):**" >> $GITHUB_STEP_SUMMARY
|
||||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
||||
echo "${{ steps.meta-minimal.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
if [ "${{ vars.ENABLE_DOCKERHUB }}" == "true" ]; then
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
@@ -115,6 +151,7 @@ jobs:
|
||||
body: |
|
||||
## 🐳 Docker Images
|
||||
|
||||
### Full (WeChat + QQ + File Manager)
|
||||
**GitHub Container Registry:**
|
||||
```bash
|
||||
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
|
||||
@@ -127,17 +164,20 @@ jobs:
|
||||
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:latest
|
||||
```
|
||||
|
||||
## 🚀 Quick Start
|
||||
**GitHub Container Registry:**
|
||||
### Minimal (WeChat only)
|
||||
```bash
|
||||
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:minimal
|
||||
```
|
||||
|
||||
## 🚀 Quick Start
|
||||
**Full:**
|
||||
```bash
|
||||
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
|
||||
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
```
|
||||
|
||||
**Docker Hub** (if enabled):
|
||||
**Minimal:**
|
||||
```bash
|
||||
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:${{ steps.meta.outputs.version }}
|
||||
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:latest
|
||||
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:minimal
|
||||
```
|
||||
|
||||
Then visit: https://localhost:3001
|
||||
Reference in New Issue
Block a user