File tree Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Publish Docker Images
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ workflow_dispatch :
8
+
9
+ jobs :
10
+ build-and-publish :
11
+ runs-on : ubuntu-latest
12
+ permissions :
13
+ contents : read
14
+ packages : write
15
+
16
+ steps :
17
+ - name : Checkout repository
18
+ uses : actions/checkout@v4
19
+
20
+ - name : Log in to GitHub Container Registry
21
+ uses : docker/login-action@v3
22
+ with :
23
+ registry : ghcr.io
24
+ username : ${{ github.actor }}
25
+ password : ${{ secrets.GITHUB_TOKEN }}
26
+
27
+ - name : Get list of Dockerfiles
28
+ id : dockerfiles
29
+ run : |
30
+ echo "files=$(find . -type f -name "*.Dockerfile" | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
31
+
32
+ - name : Set up Docker Buildx
33
+ uses : docker/setup-buildx-action@v3
34
+
35
+ - name : Build and push Docker images
36
+ run : |
37
+ for dockerfile in $(echo '${{ steps.dockerfiles.outputs.files }}' | jq -r '.[]'); do
38
+ name=$(basename "$dockerfile" .Dockerfile)
39
+
40
+ # Build and push with both latest and SHA tags
41
+ docker buildx build \
42
+ --file "$dockerfile" \
43
+ --push \
44
+ --tag "ghcr.io/buape/dockyard-${name}:latest" \
45
+ --tag "ghcr.io/buape/dockyard-${name}:${GITHUB_SHA}" \
46
+ --cache-from "type=gha" \
47
+ --cache-to "type=gha,mode=max" \
48
+ .
49
+
50
+ echo "Built and pushed ghcr.io/buape/dockyard-${name}"
51
+ done
Original file line number Diff line number Diff line change
1
+ # Dockyard
2
+
3
+ This repo is used to host a collection of Docker images that we build off of internally for our projects.
Original file line number Diff line number Diff line change
1
+ FROM oven/bun:1.1-alpine AS base
2
+ RUN apk add --no-cache libc6-compat build-base g++ cairo-dev pango-dev jpeg-dev imagemagick openssl
3
+ RUN bun i -g node-gyp
4
+ WORKDIR /app
You can’t perform that action at this time.
0 commit comments