-
Notifications
You must be signed in to change notification settings - Fork 39
119 lines (99 loc) · 3.72 KB
/
server_release.yml
File metadata and controls
119 lines (99 loc) · 3.72 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Vectorize Server Release (tag)
on:
push:
tags: ['v[0-9]+.[0-9]+.[0-9]+']
jobs:
build_and_push_amd64:
name: Build and push AMD64 images (tag)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract tag
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push -- Tag
uses: docker/build-push-action@v6
with:
context: .
file: ./server/Dockerfile
platforms: linux/amd64
push: true
tags: |
ghcr.io/chuckhend/vectorize-server:${{ steps.tag.outputs.TAG }}-amd64
ghcr.io/chuckhend/vectorize-server:latest-amd64
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: true
sbom: true
build_and_push_arm64:
name: Build and push ARM64 images (tag)
runs-on: ubicloud-standard-2-arm-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract tag
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push -- Tag
uses: docker/build-push-action@v6
with:
context: .
file: ./server/Dockerfile
platforms: linux/arm64
push: true
tags: |
ghcr.io/chuckhend/vectorize-server:${{ steps.tag.outputs.TAG }}-arm64
ghcr.io/chuckhend/vectorize-server:latest-arm64
provenance: true
sbom: true
create_manifest:
name: Create and Push Manifest (tag)
runs-on: ubuntu-latest
needs: [build_and_push_arm64, build_and_push_amd64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract tag
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Create and push Docker manifest — Version and latest
run: |
# Create a multi-arch image manifest for the version tag
docker buildx imagetools create \
--tag ghcr.io/chuckhend/vectorize-server:${{ steps.tag.outputs.TAG }} \
ghcr.io/chuckhend/vectorize-server:${{ steps.tag.outputs.TAG }}-arm64 \
ghcr.io/chuckhend/vectorize-server:${{ steps.tag.outputs.TAG }}-amd64
# Inspect the created version manifest to ensure it's correct
docker buildx imagetools inspect ghcr.io/chuckhend/vectorize-server:${{ steps.tag.outputs.TAG }}
# Create/update the 'latest' multi-arch manifest pointing to the architecture-specific latest tags
docker buildx imagetools create \
--tag ghcr.io/chuckhend/vectorize-server:latest \
ghcr.io/chuckhend/vectorize-server:latest-arm64 \
ghcr.io/chuckhend/vectorize-server:latest-amd64
# Inspect the created latest manifest
docker buildx imagetools inspect ghcr.io/chuckhend/vectorize-server:latest