Skip to content

Commit 69ea635

Browse files
committed
Build and push images on each push to main
1 parent 7540e60 commit 69ea635

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/build-docker.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: build-docker
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
7+
jobs:
8+
docker:
9+
runs-on: ubuntu-latest
10+
steps:
11+
-
12+
name: Useful variables
13+
id: setvars
14+
# ghcr.io namespaces must be lower case, but there's no native way
15+
# in the GitHub Actions expression language to convert string case,
16+
# so we have to do it ourselves in a script.
17+
run: echo "repoowner=${{ github.repository_owner }}" | tr 'A-Z' 'a-z' >> "$GITHUB_OUTPUT"
18+
19+
-
20+
name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
-
24+
name: Docker meta
25+
id: meta
26+
uses: docker/metadata-action@v5
27+
28+
-
29+
name: Build
30+
uses: docker/bake-action@v6
31+
env:
32+
PROD: "true"
33+
DBBR_REGISTRY: ghcr.io/${{ steps.setvars.outputs.repoowner }}/
34+
with:
35+
files: |
36+
./docker-bake.hcl
37+
cwd://${{ steps.meta.outputs.bake-file-labels }}
38+
push: true

0 commit comments

Comments
 (0)