Skip to content

Merge pull request #36 from PatCapon39/patch-1 #14

Merge pull request #36 from PatCapon39/patch-1

Merge pull request #36 from PatCapon39/patch-1 #14

Workflow file for this run

name: Deploy to prod
on:
push:
branches:
- master
jobs:
run_pull:
name: run server update
runs-on: ubuntu-latest
environment: Deployment
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.SSH_PRIVATE_KEY_PROD }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST_PROD }} > ~/.ssh/known_hosts
- name: connect and pull
run: ssh ${{ secrets.SSH_USER_PROD }}@${{ secrets.SSH_HOST_PROD }} "/home/ubuntu/update.sh && exit"
- name: cleanup
run: rm -rf ~/.ssh