Merge pull request #76 from pennant-notebook/landing/footer #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pennant Client CI | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Add DO Droplet to SSH known hosts | |
run: | | |
mkdir -p ~/.ssh | |
chmod 700 ~/.ssh | |
echo "142.93.60.189 $(ssh-keyscan 142.93.60.189 2>/dev/null)" >> ~/.ssh/known_hosts | |
- name: Deploy to DigitalOcean | |
env: | |
DO_SSH_KEY: ${{ secrets.DIGITALOCEAN_SSH_KEY }} | |
DO_HOST: ${{ secrets.DIGITALOCEAN_HOST }} | |
DO_USERNAME: ${{ secrets.DIGITALOCEAN_USERNAME }} | |
run: | | |
echo "$DO_SSH_KEY" > private_key.pem | |
chmod 600 private_key.pem | |
scp -i private_key.pem -r * trypennant@142.93.60.189:~/pennant-notebook/client | |
ssh -i private_key.pem trypennant@142.93.60.189 "cd ~/pennant-notebook/server && npm run build:ui && pm2 restart 0" | |
rm -f private_key.pem |