Linux app build: cargo was not in PATH for subsequent steps after shell-based install. Fixed by adding $HOME/.cargo/bin to GITHUB_PATH (persists across steps) and setting it in the job-level env. Also removed the now-unnecessary per-step PATH override in the macOS job. Container build: added QEMU setup and platforms: linux/amd64,linux/arm64 to produce a multi-arch manifest. The Dockerfile already uses arch-aware commands (dpkg --print-architecture, uname -m) so it builds natively on both architectures. This fixes the "no matching manifest for linux/arm64/v8" error on Apple Silicon Macs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
name: Build Container
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "container/**"
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "container/**"
|
|
|
|
env:
|
|
REGISTRY: repo.anhonesthost.net
|
|
IMAGE_NAME: cybercovellc/triple-c/triple-c-sandbox
|
|
|
|
jobs:
|
|
build-container:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build and push container image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./container
|
|
file: ./container/Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ gitea.event_name == 'push' }}
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ gitea.sha }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|