From 7de11bbea6f88f3b9125b543a17cb8b12c4c5ae8 Mon Sep 17 00:00:00 2001 From: efbe Date: Thu, 25 Jan 2024 08:59:43 +0700 Subject: [PATCH] tes dong --- .github/workflows/main.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4749bec..a549b30 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,18 +8,16 @@ jobs: run_pull: name: run pull runs-on: ubuntu-latest - environment: ssh_key + steps: - name: install ssh keys # check this thread to understand why its needed: # https://stackoverflow.com/a/70447517 run: | - echo "${{ secrets.SSH_HOST }}" - echo '${{ secrets.SSH_USER }}' - echo ${{ vars.WORK_DIR }} - - # ssh-keyscan -H ${{ env.SSH_HOST }} > ~/.ssh/known_hosts - # - name: connect and pull - # run: ssh ${{ env.SSH_USER }}@${{ env.SSH_HOST }} "cd ${{ env.WORK_DIR }} && git checkout ${{ env.MAIN_BRANCH }} && git pull && exit" - # - name: cleanup - # run: rm -rf ~/.ssh + install -m 600 -D /dev/null ~/.ssh/id_rsa + echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa + ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts + - name: connect and pull + run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ vars.WORK_DIR }} && git checkout main && git pull && exit" + - name: cleanup + run: rm -rf ~/.ssh \ No newline at end of file