-
Notifications
You must be signed in to change notification settings - Fork 16
175 lines (151 loc) · 5.74 KB
/
docker-publish.yml
File metadata and controls
175 lines (151 loc) · 5.74 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Build and Publish Docker Images
on:
workflow_dispatch: # Manual triggering ONLY - automatic builds disabled
# Automatic builds disabled - run manually via GitHub Actions UI
# push:
# branches:
# - master
# paths-ignore:
# - '**.md'
# - '.github/**'
# - '!.github/workflows/docker-publish.yml'
jobs:
build_backend_amd64:
runs-on: ubuntu-latest
steps:
- name: Maximize build disk space
uses: easimon/maximize-build-space@master
with:
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push backend AMD64
uses: docker/build-push-action@v7
with:
context: ./backend
file: ./backend/Dockerfile.prod
platforms: linux/amd64
push: true
tags: davidamacey/opentranscribe-backend:latest-amd64
cache-from: type=registry,ref=davidamacey/opentranscribe-backend:buildcache-amd64
cache-to: type=registry,ref=davidamacey/opentranscribe-backend:buildcache-amd64,mode=max
build_backend_arm64:
runs-on: ubuntu-latest
if: false # Disabled - build locally due to size (13.8GB) causing GitHub runner failures
steps:
- name: Maximize build disk space
uses: easimon/maximize-build-space@master
with:
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push backend ARM64
uses: docker/build-push-action@v7
with:
context: ./backend
file: ./backend/Dockerfile.prod
platforms: linux/arm64
push: true
tags: davidamacey/opentranscribe-backend:latest-arm64
cache-from: type=registry,ref=davidamacey/opentranscribe-backend:buildcache-arm64
cache-to: type=registry,ref=davidamacey/opentranscribe-backend:buildcache-arm64,mode=max
build_frontend_amd64:
runs-on: ubuntu-latest
steps:
- name: Maximize build disk space
uses: easimon/maximize-build-space@master
with:
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push frontend AMD64
uses: docker/build-push-action@v7
with:
context: ./frontend
file: ./frontend/Dockerfile.prod
platforms: linux/amd64
push: true
tags: davidamacey/opentranscribe-frontend:latest-amd64
cache-from: type=registry,ref=davidamacey/opentranscribe-frontend:buildcache-amd64
cache-to: type=registry,ref=davidamacey/opentranscribe-frontend:buildcache-amd64,mode=max
build_frontend_arm64:
runs-on: ubuntu-latest
steps:
- name: Maximize build disk space
uses: easimon/maximize-build-space@master
with:
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push frontend ARM64
uses: docker/build-push-action@v7
with:
context: ./frontend
file: ./frontend/Dockerfile.prod
platforms: linux/arm64
push: true
tags: davidamacey/opentranscribe-frontend:latest-arm64
cache-from: type=registry,ref=davidamacey/opentranscribe-frontend:buildcache-arm64
cache-to: type=registry,ref=davidamacey/opentranscribe-frontend:buildcache-arm64,mode=max
create_manifests:
needs: [build_backend_amd64, build_frontend_amd64, build_frontend_arm64]
runs-on: ubuntu-latest
steps:
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create and push backend manifest (AMD64 only for now)
run: |
docker buildx imagetools create -t davidamacey/opentranscribe-backend:latest \
davidamacey/opentranscribe-backend:latest-amd64
- name: Create and push frontend manifest
run: |
docker buildx imagetools create -t davidamacey/opentranscribe-frontend:latest \
davidamacey/opentranscribe-frontend:latest-amd64 \
davidamacey/opentranscribe-frontend:latest-arm64