# Template: Build + test + deploy on push to main# Copy to: .github/workflows/main-deploy.yml## Flow: build + test + artifact (ECR push) + deploy to EC2 via WireGuard VPN + tag.# ECR repository is auto-created by the pipeline if missing.## Required secrets:# AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_ECR_URL,# AWS_EC2_HOST, AWS_EC2_USER, AWS_EC2_SSH_KEY, AWS_APP_PORT,# WG_PRIVATE_KEY, WG_ADDRESS, WG_PEER_PUBLIC_KEY, WG_PEER_ALLOWED_IPS, WG_PEER_ENDPOINT
name: Main Build, Test & Deploy
on: push: branches: - main
permissions: contents: write # required by run_tag to push vX.Y.Z tag and create GitHub Release id-token: write
jobs: publish: if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} uses: Codehunters-IO/ci-templates/.github/workflows/contracts-main-pipeline.yml@main with: run_build: true run_test: true run_artifact: true run_deploy: true deploy_target: 'ec2-vpn' internal_port: '8545' memory_limit: '1024m' memory_reservation: '512m' push_latest: true environment: 'production' run_tag: true run_notifications: true notify_mention_on_failure: '@channel' secrets: inherit Contracts (Hardhat/Solidity)· Consumer template ·on: push
Contracts Main Deploy
Template: Build + test + deploy on push to main Copy to: .github/workflows/main-deploy.yml Flow: build + test + artifact (ECR push) + deploy to EC2 via WireGuard VPN + tag. ECR repository is auto-crea
templates/contracts-main-deploy.yml