Skip to content

Merge pull request #14 from nakajimayoshi/contributing-docs #14

Merge pull request #14 from nakajimayoshi/contributing-docs

Merge pull request #14 from nakajimayoshi/contributing-docs #14

Workflow file for this run

on:
push:
branches:
- main
workflow_dispatch:
jobs:
run_pull:
name: run pull
runs-on: ubuntu-latest
steps:
- name: install ssh keys
# check this thread to understand why its needed:
# https://stackoverflow.com/a/70447517
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.DEPLOY_SSH_HOST }} > ~/.ssh/known_hosts
- name: connect and pull
run: ssh ${{ secrets.DEPLOY_SSH_USER }}@${{ secrets.DEPLOY_SSH_HOST }} "cd ${{ secrets.DEPLOY_WORK_DIR }} && git reset --hard && git checkout ${{ secrets.DEPLOY_MAIN_BRANCH }} && git pull && exit"
- name: execute post tasks
run: ssh ${{ secrets.DEPLOY_SSH_USER }}@${{ secrets.DEPLOY_SSH_HOST }} "cd ${{ secrets.DEPLOY_WORK_DIR }} && cd ../. && ./deploy_post.sh && exit"
- name: cleanup
run: rm -rf ~/.ssh