name: Deploy Canina on: push: branches: - main - develop jobs: deploy: runs-on: canina steps: - name: Authenticated immutable host deployment (Production acceptance gated) shell: bash env: BRANCH: ${{ github.ref_name }} DEPLOY_SHA: ${{ github.sha }} DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} DEPLOY_KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }} run: | set -euo pipefail set +x [[ "${BRANCH}" == develop || "${BRANCH}" == main ]] || exit 2 [[ "${DEPLOY_SHA}" =~ ^[0-9a-f]{40}$ ]] || exit 2 # Provision DEPLOY_KNOWN_HOSTS from an independently verified host key. # Never use baked-in /opt/services, runner SSH keys or docker.sock. [[ -n "${DEPLOY_KEY}" && -n "${DEPLOY_KNOWN_HOSTS}" ]] || { echo 'Host boundary requires DEPLOY_KEY and verified DEPLOY_KNOWN_HOSTS' >&2; exit 2; } export http_proxy="" https_proxy="" HTTP_PROXY="" HTTPS_PROXY="" export no_proxy="git.parsaaghayi.ir,localhost,127.0.0.1,87.248.133.138" umask 077 wrapper=$(mktemp) trap 'rm -f "$wrapper"' EXIT wget --no-proxy -qO "$wrapper" "https://git.parsaaghayi.ir/parsa/canina/raw/commit/${DEPLOY_SHA}/scripts/ci-host-deploy.sh" bash "$wrapper"