tes dong
This commit is contained in:
parent
b17f0c1410
commit
7de11bbea6
18
.github/workflows/main.yml
vendored
18
.github/workflows/main.yml
vendored
|
@ -8,18 +8,16 @@ jobs:
|
||||||
run_pull:
|
run_pull:
|
||||||
name: run pull
|
name: run pull
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: ssh_key
|
|
||||||
steps:
|
steps:
|
||||||
- name: install ssh keys
|
- name: install ssh keys
|
||||||
# check this thread to understand why its needed:
|
# check this thread to understand why its needed:
|
||||||
# https://stackoverflow.com/a/70447517
|
# https://stackoverflow.com/a/70447517
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.SSH_HOST }}"
|
install -m 600 -D /dev/null ~/.ssh/id_rsa
|
||||||
echo '${{ secrets.SSH_USER }}'
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
||||||
echo ${{ vars.WORK_DIR }}
|
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
|
||||||
|
- name: connect and pull
|
||||||
# ssh-keyscan -H ${{ env.SSH_HOST }} > ~/.ssh/known_hosts
|
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ vars.WORK_DIR }} && git checkout main && git pull && exit"
|
||||||
# - name: connect and pull
|
- name: cleanup
|
||||||
# run: ssh ${{ env.SSH_USER }}@${{ env.SSH_HOST }} "cd ${{ env.WORK_DIR }} && git checkout ${{ env.MAIN_BRANCH }} && git pull && exit"
|
run: rm -rf ~/.ssh
|
||||||
# - name: cleanup
|
|
||||||
# run: rm -rf ~/.ssh
|
|
Loading…
Reference in New Issue
Block a user