forked from massif-01/ChatRaw_server
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (68 loc) · 2.62 KB
/
Copy pathdocker-release.yml
File metadata and controls
80 lines (68 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Publish Docker image
on:
release:
types: [published]
permissions:
contents: read
concurrency:
group: docker-release-${{ github.event.release.tag_name }}
cancel-in-progress: false
jobs:
publish:
name: Publish linux/amd64 and linux/arm64
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Validate release tag
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
if ! printf '%s' "$RELEASE_TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "Release tag must use vMAJOR.MINOR.PATCH, got: $RELEASE_TAG" >&2
exit 1
fi
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Set up QEMU
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4
- name: Log in to Docker Hub
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4
with:
username: massif01
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Generate image metadata
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
with:
images: docker.io/massif01/chatraw-server
tags: |
type=semver,pattern={{version}},value=${{ github.event.release.tag_name }}
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
labels: |
org.opencontainers.image.title=ChatRaw Server
org.opencontainers.image.description=Multi-user ChatRaw with modular backend services
- name: Build and push
id: build
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=chatraw-server
cache-to: type=gha,mode=max,scope=chatraw-server
provenance: mode=max
sbom: true
- name: Verify published platforms
env:
IMAGE: docker.io/massif01/chatraw-server
VERSION: ${{ steps.meta.outputs.version }}
run: |
docker buildx imagetools inspect "$IMAGE:$VERSION" > /tmp/manifest.txt
grep -q 'linux/amd64' /tmp/manifest.txt
grep -q 'linux/arm64' /tmp/manifest.txt
cat /tmp/manifest.txt