Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix

fix #162

Workflow file for this run

name: 'Deploy demo'
on:
push:
branches: [main]
defaults:
run:
shell: bash
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: demo
steps:
- name: Prepare keys
run: |
mkdir -p ~/.ssh
echo -e "$KEY" > ~/.ssh/id_rsa
chmod og-rwx ~/.ssh/id_rsa
ssh-keyscan $HOST >> ~/.ssh/known_hosts
env:
HOST: ${{ secrets.REMOTE_HOST }}
KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Deploy
run: ssh $USER@$HOST $COMMAND && ssh $USER@$HOST $RESTART
env:
HOST: ${{ secrets.REMOTE_HOST }}
USER: ${{ secrets.REMOTE_USER }}
COMMAND: >
sudo -u node /home/node/app/postdeploy.sh
RESTART: >
sudo systemctl restart app.service