Skip to content

Merge pull request #202 from Black-Dot-2024/staging #3

Merge pull request #202 from Black-Dot-2024/staging

Merge pull request #202 from Black-Dot-2024/staging #3

Workflow file for this run

name: Deploy to EC2
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install PNPM
run: npm install -g pnpm
- name: Copy files to EC2
uses: appleboy/scp-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
port: 22
source: '.'
target: '/home/ubuntu/Zeitgeist-Backend'
- name: Deploy application
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
port: 22
script: |
cd /home/ubuntu/Zeitgeist-Backend
git pull origin main
pnpm install
pnpm run build
pm2 reload "production"