Skip to content

Update main.yml

Update main.yml #7

Workflow file for this run

on:
push:
branches:
- dev
workflow_dispatch:
jobs:
run_pull:
name: run pull
runs-on: ubuntu-latest
steps:
- name: install ssh keys
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.HOST }} -p ${{ secrets.PORT }} > ~/.ssh/known_hosts
- name: connect and pull
run: ssh ${{ secrets.USER }}@${{ secrets.HOST }} -p ${{ secrets.PORT }} "cd ${{ secrets.DIST }} && git checkout dev && git pull && exit"
- name: cleanup
run: rm -rf ~/.ssh