Skip to content

Deploy to dev

Deploy to dev #59

Workflow file for this run

name: Deploy to dev
on:
workflow_run:
workflows: ["Django tests"]
types:
- completed
branches:
- dev
jobs:
run_pull:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
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_DEV }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST_DEV }} > ~/.ssh/known_hosts
- name: connect and pull
run: ssh ${{ secrets.SSH_USER_DEV }}@${{ secrets.SSH_HOST_DEV }} "/home/ubuntu/update.sh && exit"
- name: cleanup
run: rm -rf ~/.ssh