diff --git a/.gitea/workflows/generate-readme.yml b/.gitea/workflows/generate-readme.yml index 349f766..2c158b4 100644 --- a/.gitea/workflows/generate-readme.yml +++ b/.gitea/workflows/generate-readme.yml @@ -21,9 +21,25 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Setup Git remote + - name: Setup SSH with deploy key + env: + DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} run: | - git remote set-url origin https://git.hudsonriggs.systems/HRiggs/tools.git + mkdir -p ~/.ssh + chmod 700 ~/.ssh + printf '%s\n' "$DEPLOY_KEY" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + eval "$(ssh-agent -s)" + ssh-add ~/.ssh/id_rsa + ssh-keyscan -p 22113 -H git.hudsonriggs.systems >> ~/.ssh/known_hosts + { + echo "Host git.hudsonriggs.systems"; + echo " HostName git.hudsonriggs.systems"; + echo " Port 22113"; + echo " User git"; + } >> ~/.ssh/config + chmod 600 ~/.ssh/config + git remote set-url origin ssh://git@git.hudsonriggs.systems:22113/HRiggs/tools.git - name: Generate README run: | @@ -44,7 +60,7 @@ jobs: env: BRANCH_NAME: ${{ github.ref_name }} run: | - : "Pushing to branch ${BRANCH_NAME} via HTTPS" + : "Pushing to branch ${BRANCH_NAME} via SSH" git push origin HEAD:"${BRANCH_NAME}"