name: Deploy Production on: workflow_dispatch: inputs: version: description: 'Version tag to deploy (e.g., v0.1.21)' required: true type: string env: REGISTRY: docker.notsosm.art IMAGE_NAME: euchre-camp PROD_APPS_PATH: /apps/youthful_simon jobs: deploy-prod: runs-on: ubuntu-latest container: image: docker.notsosm.art/euchre-camp/ci-base:latest options: --user root steps: - name: Deploy to production run: | VERSION="${{ inputs.version }}" COMPOSE_FILE="${{ env.PROD_APPS_PATH }}/docker-compose.yml" echo "Deploying ${VERSION} to production..." # Update prod compose file with the release tag # Note: Standardizing to docker.notsosm.art registry sed -i "s|image: euchre-camp/euchre-camp:[a-zA-Z0-9.-]*|image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${VERSION}|" ${COMPOSE_FILE} sed -i "s|image: docker.notsosm.art/euchre-camp:[a-zA-Z0-9.-]*|image: docker.notsosm.art/euchre-camp:${VERSION}|" ${COMPOSE_FILE} # Pull and restart the prod container cd ${{ env.PROD_APPS_PATH }} docker compose pull app docker compose up -d app # Wait for production site to be healthy echo "Waiting for production site to be healthy..." for i in {1..6}; do if curl -sf https://euchre.notsosm.art/api/health > /dev/null 2>&1; then echo "✅ Production successfully deployed with version ${VERSION}" exit 0 fi sleep 15 done echo "❌ Production deployment failed" docker compose logs app exit 1