All checks were successful
Build and Push OCI Image / build (push) Successful in 2m20s
- Update flake outputs: solidhaus-image → kammer-image - Update registry references: registry.toph.so/solidhaus → registry.toph.so/kammer - Update workflow to build and push kammer image - Update package names and metadata Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
57 lines
1.8 KiB
YAML
57 lines
1.8 KiB
YAML
name: Build and Push OCI Image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: nix
|
|
steps:
|
|
- name: Checkout code
|
|
uses: https://code.forgejo.org/actions/checkout@v4
|
|
|
|
- name: Build OCI image
|
|
run: |
|
|
# Try with cache first, fall back to building from source
|
|
nix build .#kammer-image \
|
|
--print-build-logs \
|
|
--show-trace || {
|
|
echo "Build failed, retrying with --no-substitute to build from source..."
|
|
nix build .#kammer-image \
|
|
--print-build-logs \
|
|
--show-trace \
|
|
--option substitute false
|
|
}
|
|
|
|
- name: Push to registry
|
|
if: github.ref == 'refs/heads/main'
|
|
run: |
|
|
# Ensure temp directory exists for skopeo
|
|
mkdir -p /var/tmp /tmp
|
|
|
|
image=$(nix build --no-link --print-out-paths .#kammer-image)
|
|
skopeo copy \
|
|
--dest-tls-verify=false \
|
|
--tmpdir /tmp \
|
|
"docker-archive:$image" \
|
|
"docker://registry.toph.so/kammer:latest"
|
|
|
|
# Also tag with commit SHA
|
|
skopeo copy \
|
|
--dest-tls-verify=false \
|
|
--tmpdir /tmp \
|
|
"docker-archive:$image" \
|
|
"docker://registry.toph.so/kammer:${GITHUB_SHA:0:7}"
|
|
|
|
- name: Build summary
|
|
if: github.ref == 'refs/heads/main'
|
|
run: |
|
|
echo "### ✅ Image Built and Pushed" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "- **Image**: registry.toph.so/kammer:latest" >> $GITHUB_STEP_SUMMARY
|
|
echo "- **Tag**: ${GITHUB_SHA:0:7}" >> $GITHUB_STEP_SUMMARY
|
|
echo "- **Commit**: ${GITHUB_SHA}" >> $GITHUB_STEP_SUMMARY
|