Skip to content

cmd line arg --network to create shared network for sidecar #16

cmd line arg --network to create shared network for sidecar

cmd line arg --network to create shared network for sidecar #16

name: Build and Push Image
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out repository
uses: actions/checkout@v6.0.2
- name: Login to GitHub Container Registry
uses: docker/login-action@v4.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Image with buildah script
id: build
env:
STORAGE_DRIVER: vfs
run: |
# Extract <owner>/<repository-name> in lower case
REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
# Run the build script
VERSION=$(./devops/build-image.sh -repo-name $REPO_NAME | tail -n2 | head -n1 | cut -d: -f2)
# Tag the image for GHCR
buildah tag claude-code \
"ghcr.io/$REPO_NAME/claude-code:$VERSION" \
"ghcr.io/$REPO_NAME/claude-code:latest"
echo "repo_name=$REPO_NAME" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Test image
run: ./tests/test-image.sh "${{ steps.build.outputs.version }}"
- name: Push to GitHub Container Registry
run: |
buildah push "ghcr.io/${{ steps.build.outputs.repo_name }}/claude-code:${{ steps.build.outputs.version }}"
buildah push "ghcr.io/${{ steps.build.outputs.repo_name }}/claude-code:latest"