-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb96561
commit 9174852
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build and Publish Docker Images | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get list of Dockerfiles | ||
id: dockerfiles | ||
run: | | ||
echo "files=$(find . -type f -name "*.Dockerfile" | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push Docker images | ||
run: | | ||
for dockerfile in $(echo '${{ steps.dockerfiles.outputs.files }}' | jq -r '.[]'); do | ||
name=$(basename "$dockerfile" .Dockerfile) | ||
# Build and push with both latest and SHA tags | ||
docker buildx build \ | ||
--file "$dockerfile" \ | ||
--push \ | ||
--tag "ghcr.io/buape/dockyard-${name}:latest" \ | ||
--tag "ghcr.io/buape/dockyard-${name}:${GITHUB_SHA}" \ | ||
--cache-from "type=gha" \ | ||
--cache-to "type=gha,mode=max" \ | ||
. | ||
echo "Built and pushed ghcr.io/buape/dockyard-${name}" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Dockyard | ||
|
||
This repo is used to host a collection of Docker images that we build off of internally for our projects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM oven/bun:1.1-alpine AS base | ||
RUN apk add --no-cache libc6-compat build-base g++ cairo-dev pango-dev jpeg-dev imagemagick openssl | ||
RUN bun i -g node-gyp | ||
WORKDIR /app |