Skip to content

Rename bun_canvas.dockerfile to bun_canvas.Dockerfile #4

Rename bun_canvas.dockerfile to bun_canvas.Dockerfile

Rename bun_canvas.dockerfile to bun_canvas.Dockerfile #4

Workflow file for this run

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 ./images -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