diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..0614caf --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..cb38801 --- /dev/null +++ b/README.md @@ -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. \ No newline at end of file diff --git a/images/bun_canvas.dockerfile b/images/bun_canvas.dockerfile new file mode 100644 index 0000000..a0d9878 --- /dev/null +++ b/images/bun_canvas.dockerfile @@ -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 \ No newline at end of file