Skip to content

Commit 194c21d

Browse files
committed
Updated Actions
1 parent c616923 commit 194c21d

File tree

2 files changed

+9
-24
lines changed

2 files changed

+9
-24
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: Build & Push (GHCR)
22

33
on:
4+
workflow_dispatch: {}
45
push:
5-
branches: [ main ]
6+
branches: ["main"]
67
paths:
78
- "server/**"
89
- "client/**"
910
- "pyworker/**"
10-
- "nginx/**"
1111
- "docker-bake.hcl"
1212
- ".github/workflows/build.yml"
1313

@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup Buildx
2828
uses: docker/setup-buildx-action@v3
2929

30-
# Build & push :latest when building main
30+
# latest for main
3131
- name: Build & Push :latest (main only)
3232
if: github.ref == 'refs/heads/main'
3333
env:
@@ -36,11 +36,11 @@ jobs:
3636
run: |
3737
docker buildx bake -f docker-bake.hcl --push
3838
39-
# Build & push :<short-sha> on every run
39+
# short SHA every run (handy for rollbacks)
4040
- name: Build & Push :short-sha
4141
env:
4242
REGISTRY: ghcr.io/cornellev
4343
TAG: ${{ github.sha }}
4444
run: |
45-
SHORT="${TAG::7}" # <-- bash slicing, not GHA substr()
46-
REGISTRY="$REGISTRY" TAG="$SHORT" docker buildx bake -f docker-bake.hcl --push
45+
SHORT="${TAG::7}"
46+
REGISTRY="$REGISTRY" TAG="$SHORT" docker buildx bake -f docker-bake.hcl --push

docker-bake.hcl

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,8 @@
1-
variable "REGISTRY" {
2-
default = "ghcr.io/cornellev"
3-
}
4-
5-
variable "TAG" {
6-
default = "latest"
7-
}
1+
variable "REGISTRY" { default = "ghcr.io/cornellev" }
2+
variable "TAG" { default = "latest" }
83

94
group "default" {
10-
targets = ["nginx", "server", "client", "worker"]
11-
}
12-
13-
target "nginx" {
14-
context = "./nginx"
15-
tags = ["${REGISTRY}/viz-nginx:${TAG}"]
16-
platforms = ["linux/amd64"]
17-
labels = {
18-
"org.opencontainers.image.source" = "https://github.com/cornellev/VisualizationToolbox"
19-
}
20-
push = true
5+
targets = ["server", "client", "worker"]
216
}
227

238
target "server" {

0 commit comments

Comments
 (0)