File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 6969 if : github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
7070 runs-on : ubuntu-latest
7171 steps :
72+ - name : Fetch deploy credentials from KMS
73+ id : kms
74+ env :
75+ HANZO_API_KEY : ${{ secrets.HANZO_API_KEY }}
76+ KMS_ENDPOINT : ${{ vars.KMS_ENDPOINT || 'https://kms.hanzo.ai' }}
77+ run : |
78+ response=$(curl -sf "${KMS_ENDPOINT}/api/v1/secrets/raw?secretPath=/deploy&environment=production" \
79+ -H "Authorization: Bearer ${HANZO_API_KEY}" 2>/dev/null || echo "")
80+ if [ -n "$response" ]; then
81+ token=$(echo "$response" | jq -r '.secrets[] | select(.secretKey=="DO_API_TOKEN") | .secretValue // empty')
82+ fi
83+ if [ -z "${token:-}" ]; then
84+ echo "::error::Deploy credentials not found. Set HANZO_API_KEY with KMS access."
85+ exit 1
86+ fi
87+ echo "::add-mask::${token}"
88+ echo "token=${token}" >> "$GITHUB_OUTPUT"
89+
7290 - name : Deploy to lux-k8s
7391 env :
74- DIGITALOCEAN_ACCESS_TOKEN : ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
92+ DO_TOKEN : ${{ steps.kms.outputs.token }}
7593 run : |
7694 INSTALL_DIR="$HOME/.local/bin"
7795 mkdir -p "$INSTALL_DIR"
84102 curl -sLO "https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
85103 chmod +x kubectl && mv kubectl "$INSTALL_DIR/kubectl"
86104 fi
87- doctl auth init -t "$DIGITALOCEAN_ACCESS_TOKEN "
105+ doctl auth init -t "$DO_TOKEN "
88106 doctl kubernetes cluster kubeconfig save lux-k8s
89107 # Mainnet explorers
90108 for dep in explorer-mainnet explorer-zoo explorer-hanzo explorer-spc explorer-pars; do
You can’t perform that action at this time.
0 commit comments