Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .github/workflows/build-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ jobs:
with:
fetch-depth: 0

- name: Convert repository owner to lowercase
id: repo-owner
run: |
echo "lowercase=${GITHUB_REPOSITORY_OWNER@L}" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -56,15 +61,15 @@ jobs:
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
username: ${{ steps.repo-owner.outputs.lowercase }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/fullstack-web-runtime
ghcr.io/${{ steps.repo-owner.outputs.lowercase }}/fullstack-web-runtime
${{ env.DOCKERHUB_USERNAME && format('docker.io/{0}/fullstack-web-runtime', env.DOCKERHUB_USERNAME) || '' }}
tags: |
type=ref,event=branch
Expand All @@ -77,7 +82,7 @@ jobs:
labels: |
org.opencontainers.image.title=FullStack Web Runtime
org.opencontainers.image.description=Full-stack web development runtime with Next.js, shadcn/ui, Claude Code CLI, and container tools
org.opencontainers.image.vendor=${{ github.repository_owner }}
org.opencontainers.image.vendor=${{ steps.repo-owner.outputs.lowercase }}

- name: Build and Push Docker Image
id: docker-build
Expand Down Expand Up @@ -120,7 +125,7 @@ jobs:
body += `**Note**: PR builds only verify the Docker build process. `;
body += `Images are pushed to registries only when merged to main.\n\n`;
body += `**Registries**:\n`;
body += `- GitHub Container Registry: \`ghcr.io/${{ github.repository_owner }}/fullstack-web-runtime\`\n`;
body += `- GitHub Container Registry: \`ghcr.io/${{ steps.repo-owner.outputs.lowercase }}/fullstack-web-runtime\`\n`;
if ('${{ env.DOCKERHUB_USERNAME }}') {
body += `- Docker Hub: \`docker.io/${{ env.DOCKERHUB_USERNAME }}/fullstack-web-runtime\`\n`;
}
Expand Down Expand Up @@ -182,7 +187,7 @@ jobs:
if [ "${{ steps.docker-build.outcome }}" = "success" ]; then
echo "- ✅ Runtime build successful" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Platform: \`linux/amd64\`" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Pushed to GitHub Container Registry: \`ghcr.io/${{ github.repository_owner }}/fullstack-web-runtime\`" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Pushed to GitHub Container Registry: \`ghcr.io/${{ steps.repo-owner.outputs.lowercase }}/fullstack-web-runtime\`" >> $GITHUB_STEP_SUMMARY
if [ -n "${{ env.DOCKERHUB_USERNAME }}" ]; then
echo "- ✅ Pushed to Docker Hub: \`docker.io/${{ env.DOCKERHUB_USERNAME }}/fullstack-web-runtime\`" >> $GITHUB_STEP_SUMMARY
fi
Expand Down Expand Up @@ -214,11 +219,11 @@ jobs:
echo "### Usage Example" >> $GITHUB_STEP_SUMMARY
echo '```bash' >> $GITHUB_STEP_SUMMARY
echo "# Pull the latest image" >> $GITHUB_STEP_SUMMARY
echo "docker pull ghcr.io/${{ github.repository_owner }}/fullstack-web-runtime:latest" >> $GITHUB_STEP_SUMMARY
echo "docker pull ghcr.io/${{ steps.repo-owner.outputs.lowercase }}/fullstack-web-runtime:latest" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "# Run with environment variables" >> $GITHUB_STEP_SUMMARY
echo "docker run -d -p 7681:7681 -p 3000:3000 \\" >> $GITHUB_STEP_SUMMARY
echo " -e ANTHROPIC_AUTH_TOKEN=your_token \\" >> $GITHUB_STEP_SUMMARY
echo " -e PROJECT_NAME=my-project \\" >> $GITHUB_STEP_SUMMARY
echo " ghcr.io/${{ github.repository_owner }}/fullstack-web-runtime:latest" >> $GITHUB_STEP_SUMMARY
echo " ghcr.io/${{ steps.repo-owner.outputs.lowercase }}/fullstack-web-runtime:latest" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
30 changes: 20 additions & 10 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ jobs:
with:
fetch-depth: 0

- name: Convert repository owner to lowercase
id: repo-owner
run: |
echo "lowercase=${GITHUB_REPOSITORY_OWNER@L}" >> $GITHUB_OUTPUT

- name: Set up QEMU
if: ${{ matrix.arch != runner.arch }}
uses: docker/setup-qemu-action@v3
Expand All @@ -81,15 +86,15 @@ jobs:
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
username: ${{ steps.repo-owner.outputs.lowercase }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/fullstack-agent
ghcr.io/${{ steps.repo-owner.outputs.lowercase }}/fullstack-agent
${{ env.DOCKERHUB_USERNAME && format('docker.io/{0}/fullstack-agent', env.DOCKERHUB_USERNAME) || '' }}

- name: Build for ${{ matrix.arch }}
Expand All @@ -103,7 +108,7 @@ jobs:
# PR builds: load locally for validation, Push builds: push by digest
push: false
load: ${{ github.event_name == 'pull_request' }}
outputs: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' && format('type=image,"name=ghcr.io/{0}/fullstack-agent{1}",name-canonical=true,push-by-digest=true,push=true', github.repository_owner, env.DOCKERHUB_USERNAME && format(',docker.io/{0}/fullstack-agent', env.DOCKERHUB_USERNAME) || '') || '' }}
outputs: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' && format('type=image,"name=ghcr.io/{0}/fullstack-agent{1}",name-canonical=true,push-by-digest=true,push=true', steps.repo-owner.outputs.lowercase, env.DOCKERHUB_USERNAME && format(',docker.io/{0}/fullstack-agent', env.DOCKERHUB_USERNAME) || '') || '' }}
cache-from: type=gha,scope=build-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=build-${{ matrix.arch }}

Expand Down Expand Up @@ -148,7 +153,7 @@ jobs:
body += `**Note**: PR builds only verify the Docker build process for linux/amd64. `;
body += `Multi-platform images (amd64 + arm64) are built and pushed to registries only when merged to main.\n\n`;
body += `**Registries**:\n`;
body += `- GitHub Container Registry: \`ghcr.io/${{ github.repository_owner }}/fullstack-agent\`\n`;
body += `- GitHub Container Registry: \`ghcr.io/${{ steps.repo-owner.outputs.lowercase }}/fullstack-agent\`\n`;
if ('${{ env.DOCKERHUB_USERNAME }}') {
body += `- Docker Hub: \`docker.io/${{ env.DOCKERHUB_USERNAME }}/fullstack-agent\`\n`;
}
Expand Down Expand Up @@ -202,6 +207,11 @@ jobs:
if: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }}

steps:
- name: Convert repository owner to lowercase
id: repo-owner
run: |
echo "lowercase=${GITHUB_REPOSITORY_OWNER@L}" >> $GITHUB_OUTPUT

- name: Login to Docker Hub
if: ${{ env.DOCKERHUB_USERNAME != '' }}
uses: docker/login-action@v3
Expand All @@ -213,7 +223,7 @@ jobs:
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
username: ${{ steps.repo-owner.outputs.lowercase }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download digests
Expand All @@ -231,7 +241,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/fullstack-agent
ghcr.io/${{ steps.repo-owner.outputs.lowercase }}/fullstack-agent
${{ env.DOCKERHUB_USERNAME && format('docker.io/{0}/fullstack-agent', env.DOCKERHUB_USERNAME) || '' }}
tags: |
type=ref,event=branch
Expand All @@ -247,13 +257,13 @@ jobs:
run: |
for TAG in $DOCKER_METADATA_OUTPUT_TAGS; do
docker buildx imagetools create -t $TAG \
$(printf 'ghcr.io/${{ github.repository_owner }}/fullstack-agent@sha256:%s ' *)
$(printf 'ghcr.io/${{ steps.repo-owner.outputs.lowercase }}/fullstack-agent@sha256:%s ' *)
sleep 3
done

- name: Inspect image
run: |
docker buildx imagetools inspect ghcr.io/${{ github.repository_owner }}/fullstack-agent:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ghcr.io/${{ steps.repo-owner.outputs.lowercase }}/fullstack-agent:${{ steps.meta.outputs.version }}

- name: Generate build summary
if: always()
Expand All @@ -264,7 +274,7 @@ jobs:
if [ "${{ job.status }}" = "success" ]; then
echo "- ✅ Multi-architecture build successful" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Platforms: \`linux/amd64\`, \`linux/arm64\`" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Pushed to GitHub Container Registry: \`ghcr.io/${{ github.repository_owner }}/fullstack-agent\`" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Pushed to GitHub Container Registry: \`ghcr.io/${{ steps.repo-owner.outputs.lowercase }}/fullstack-agent\`" >> $GITHUB_STEP_SUMMARY
if [ -n "${{ env.DOCKERHUB_USERNAME }}" ]; then
echo "- ✅ Pushed to Docker Hub: \`docker.io/${{ env.DOCKERHUB_USERNAME }}/fullstack-agent\`" >> $GITHUB_STEP_SUMMARY
fi
Expand All @@ -282,4 +292,4 @@ jobs:
echo "### Image Tags" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
Loading