Skip to content

Merge pull request #250 from Black-Dot-2024/develop #10

Merge pull request #250 from Black-Dot-2024/develop

Merge pull request #250 from Black-Dot-2024/develop #10

Workflow file for this run

name: Deploy to EC2
on:
push:
branches:
- staging
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/Staging-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/Staging-Zeitgeist-Backend
git pull origin staging
pnpm install
pnpm run build
pm2 reload "staging"