forge-guard 0.3.5

Pre-deployment smart contract auditing framework for Foundry
Documentation
# ═══════════════════════════════════════════════════════════════════════
#  Docker — build & publish multi-arch image to GitHub Container Registry
# ═══════════════════════════════════════════════════════════════════════
#
#  On every v* tag push, builds forge-guard for linux/amd64 and
#  linux/arm64 (Foundry + forge-guard) and publishes to ghcr.io:
#
#    ghcr.io/codetibo/forge-guard:latest
#    ghcr.io/codetibo/forge-guard:v0.3.3
#
#  Trigger: tag push (v*)
#
name: Docker

on:
  push:
    tags: ['v*']
  # Manual dispatch for testing without a tag
  workflow_dispatch:

env:
  REGISTRY: ghcr.io
  IMAGE_NAME: ${{ github.repository }}

jobs:
  docker:
    name: Build & publish multi-arch image
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write

    steps:
      - name: Checkout
        uses: actions/checkout@v7

      - name: Set up QEMU (for linux/arm64 emulation)
        uses: docker/setup-qemu-action@v3

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

      - name: Log in to GitHub Container Registry
        uses: docker/login-action@v3
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Extract metadata (tags, labels)
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
          tags: |
            # Tag the exact version, e.g. v0.3.3 -> :v0.3.3
            type=semver,pattern={{version}}
            # Also tag :latest for every release
            type=raw,value=latest
          labels: |
            org.opencontainers.image.source=https://github.com/${{ github.repository }}
            org.opencontainers.image.description=Pre-deployment smart contract auditing framework for Foundry
            org.opencontainers.image.licenses=MIT

      - name: Build and push multi-arch image
        uses: docker/build-push-action@v6
        with:
          context: .
          push: true
          platforms: linux/amd64,linux/arm64
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          cache-from: type=gha
          cache-to: type=gha,mode=max