-
Notifications
You must be signed in to change notification settings - Fork 97
67 lines (59 loc) · 1.87 KB
/
build-universal.yml
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
name: Build And Push Universal
on:
push:
branches:
- main
release:
types: [published]
jobs:
build-amd64:
uses: ./.github/workflows/build.yml
with:
runner: ubuntu-latest
arch: amd64
arch_label: AMD64
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
build-arm64:
uses: ./.github/workflows/build.yml
with:
runner: arm64_runner
arch: arm64
arch_label: ARM64
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
build-universal:
needs: [build-amd64, build-arm64]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ vars.DIFY_SANDBOX_IMAGE_NAME || 'langgenius/dify-sandbox' }}
tags: |
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
type=ref,event=branch
type=sha,enable=true,priority=100,prefix=,suffix=,format=long
type=raw,value=${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/tags/') }}
- name: Build Universal Docker Images
run:
for tag in $(echo "${{ steps.meta.outputs.tags }}" | tr ',' '\n');
do
docker manifest create $tag $tag-amd64 $tag-arm64;
done
- name: Push Universal Docker Image
run:
for tag in $(echo "${{ steps.meta.outputs.tags }}" | tr ',' '\n');
do
docker manifest push $tag;
done