#!/bin/bash # Test Docker push workflow locally using act # Usage: scripts/test-docker-push.sh set -e echo "๐Ÿงช Testing Docker Push Workflow Locally" echo "======================================" echo "" # Check requirements if ! command -v act >/dev/null 2>&1; then echo "โŒ act not found. Please install act first." echo " brew install act" exit 1 fi if ! command -v docker >/dev/null 2>&1; then echo "โŒ Docker not found. Please install Docker first." exit 1 fi echo "โœ… Requirements met" echo "" # Test the Docker push workflow echo "1. Testing Docker push workflow with act..." echo " This may take a few minutes..." echo "" # Run act with the docker-push workflow act \ -W .gitea/workflows/docker-push.yaml \ --job docker-push \ --secret GITEA_TOKEN=dummy_token \ --secret PACKAGES_TOKEN=dummy_token \ --env GITEA_INTERNAL=https://gitea.arcodange.lab/ \ --env GITEA_EXTERNAL=https://gitea.arcodange.fr/ \ --env GITEA_ORG=arcodange \ --env GITEA_REPO=dance-lessons-coach \ --env CI_REGISTRY=gitea.arcodange.lab echo "" echo "โœ… Local testing complete!" echo "" echo "๐Ÿ’ก If the test failed, check:" echo " - Dockerfile.prod.template syntax" echo " - Dependency hash calculation" echo " - Docker build context" echo " - Go module dependencies" echo "" echo "๐Ÿ’ก To test specific scenarios:" echo " act -W .gitea/workflows/docker-push.yaml --list" echo " act -W .gitea/workflows/docker-push.yaml --job docker-push --dryrun"