@@ -123,8 +123,8 @@ jobs:
123
123
sleep 5
124
124
git ls-remote --tags origin | grep "refs/tags/${{ steps.tag_version.outputs.next_version }}" || (echo "Tag push verification failed!" && exit 1)
125
125
echo "Tag successfully pushed."
126
-
127
- build_and_push_docker_image :
126
+
127
+ build_and_push_backend_image :
128
128
runs-on : ubuntu-latest
129
129
needs : tag_release # Depends on the tag being created successfully
130
130
permissions :
@@ -156,7 +156,7 @@ jobs:
156
156
# Optionally add 'latest' tag if building from the default branch
157
157
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || github.event.inputs.branch == github.event.repository.default_branch }}
158
158
159
- - name : Build and push Docker image
159
+ - name : Build and push surfsense backend
160
160
uses : docker/build-push-action@v5
161
161
with :
162
162
context : ./surfsense_backend
@@ -166,3 +166,46 @@ jobs:
166
166
# Optional: Add build cache for faster builds
167
167
cache-from : type=gha
168
168
cache-to : type=gha,mode=max
169
+
170
+ build_and_push_ui_image :
171
+ runs-on : ubuntu-latest
172
+ needs : tag_release # Depends on the tag being created successfully
173
+ permissions :
174
+ packages : write # Need permission to write to GHCR
175
+ contents : read # Need permission to read repo contents (checkout)
176
+
177
+ steps :
178
+ - name : Checkout code
179
+ uses : actions/checkout@v4
180
+
181
+ - name : Login to GitHub Container Registry
182
+ uses : docker/login-action@v3
183
+ with :
184
+ registry : ghcr.io
185
+ username : ${{ github.repository_owner }}
186
+ password : ${{ secrets.GITHUB_TOKEN }}
187
+
188
+ - name : Set up Docker Buildx
189
+ uses : docker/setup-buildx-action@v3
190
+
191
+ - name : Extract metadata (tags, labels) for Docker build
192
+ id : meta
193
+ uses : docker/metadata-action@v5
194
+ with :
195
+ images : ghcr.io/${{ github.repository_owner }}/surfsense_ui
196
+ tags : |
197
+ # Use the tag generated in the previous job
198
+ type=raw,value=${{ needs.tag_release.outputs.new_tag }}
199
+ # Optionally add 'latest' tag if building from the default branch
200
+ type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || github.event.inputs.branch == github.event.repository.default_branch }}
201
+
202
+ - name : Build and push surfsense UI image
203
+ uses : docker/build-push-action@v5
204
+ with :
205
+ context : ./surfsense_web
206
+ push : true
207
+ tags : ${{ steps.meta.outputs.tags }}
208
+ labels : ${{ steps.meta.outputs.labels }}
209
+ # Optional: Add build cache for faster builds
210
+ cache-from : type=gha
211
+ cache-to : type=gha,mode=max
0 commit comments