Skip to content

Commit efe6e76

Browse files
committed
Add ARM64 Docker build, sync workflow, and fix image compression in Chat/Channel
1 parent 1d343ae commit efe6e76

File tree

5 files changed

+155
-815
lines changed

5 files changed

+155
-815
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build ARM64 Docker Image
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- dev
9+
tags:
10+
- v*
11+
12+
env:
13+
REGISTRY: ghcr.io
14+
15+
jobs:
16+
build-arm64-image:
17+
runs-on: ubuntu-24.04-arm
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- name: Set repository and image name to lowercase
24+
run: |
25+
echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
26+
echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV}
27+
env:
28+
IMAGE_NAME: '${{ github.repository }}'
29+
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
- name: Set up QEMU
34+
uses: docker/setup-qemu-action@v3
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
38+
39+
- name: Log in to the Container registry
40+
uses: docker/login-action@v3
41+
with:
42+
registry: ${{ env.REGISTRY }}
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Extract metadata for Docker images
47+
id: meta
48+
uses: docker/metadata-action@v5
49+
with:
50+
images: ${{ env.FULL_IMAGE_NAME }}
51+
tags: |
52+
type=ref,event=branch
53+
type=ref,event=tag
54+
type=sha,prefix=git-
55+
type=semver,pattern={{version}}
56+
type=semver,pattern={{major}}.{{minor}}
57+
flavor: |
58+
latest=${{ github.ref == 'refs/heads/main' }}
59+
60+
- name: Extract metadata for Docker cache
61+
id: cache-meta
62+
uses: docker/metadata-action@v5
63+
with:
64+
images: ${{ env.FULL_IMAGE_NAME }}
65+
tags: |
66+
type=ref,event=branch
67+
${{ github.ref_type == 'tag' && 'type=raw,value=main' || '' }}
68+
flavor: |
69+
prefix=cache-arm64-
70+
latest=false
71+
72+
- name: Build and push Docker image
73+
uses: docker/build-push-action@v5
74+
id: build
75+
with:
76+
context: .
77+
push: true
78+
platforms: linux/arm64
79+
tags: ${{ steps.meta.outputs.tags }}
80+
labels: ${{ steps.meta.outputs.labels }}
81+
cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }}
82+
cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
83+
build-args: |
84+
BUILD_HASH=${{ github.sha }}
85+
86+
- name: Inspect image
87+
run: |
88+
docker buildx imagetools inspect ${{ env.FULL_IMAGE_NAME }}:${{ steps.meta.outputs.version }}

0 commit comments

Comments
 (0)