From cf6ff4c4f834f7b288c19b3fadbf5aedc0e8e08f Mon Sep 17 00:00:00 2001 From: david gauchard Date: Tue, 27 Jul 2021 00:33:39 +0200 Subject: [PATCH] reinstall ssh private keys from GH secrets (#8245) --- package/deploy_package_index.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/package/deploy_package_index.sh b/package/deploy_package_index.sh index 6f6ad920e..b940c7d0f 100644 --- a/package/deploy_package_index.sh +++ b/package/deploy_package_index.sh @@ -10,13 +10,23 @@ cd $(dirname "$0") set -e # Abort with error if anything here does not go as expected! +# Install SSH private key from a GH Secret +echo $GHCI_DEPLOY_KEY | base64 -d > esp8266_github_io_deploy +eval "$(ssh-agent -s)" +chmod 600 esp8266_github_io_deploy +ssh-add esp8266_github_io_deploy +mkdir -p ~/.ssh +chmod go-w ~/.ssh +echo -e "Host github.com\nStrictHostKeyChecking no\n" >> ~/.ssh/config +chmod go-w ~/.ssh/config + # Clone the Github pages repository git clone git@github.com:esp8266/esp8266.github.io.git pushd esp8266.github.io # Copy from published release, ensure JSON valid rm -f stable/package_esp8266com_index.json -wget "https://github.com/esp8266/Arduino/releases/download/"$tag"/package_esp8266com_index.json" -O stable/package_esp8266com_index.json +wget https://github.com/esp8266/Arduino/releases/download/$tag/package_esp8266com_index.json -O stable/package_esp8266com_index.json cat stable/package_esp8266com_index.json | jq empty git add stable/package_esp8266com_index.json