Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .github/workflows/develop.yml

This file was deleted.

39 changes: 23 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
name: Deploy on production
name: Deploy clientside to EC2

on:
push:
branches:
- main
pull_request:
types: [closed]
branches:
- main
- v-15

jobs:
build:
name: "Fetching and restarting admin subdomain"
name: "Fetching and restarting supervisorctl"
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Execute commands via SSH
uses: appleboy/ssh-action@master
uses: appleboy/ssh-action@v1.0.0
with:
host: 43.205.81.36
username: "oh"
host: ${{ secrets.EC2_IP }}
username: onehash
key: ${{ secrets.EC2_KEY }}
script: |
echo "Deploying to EC2"
cd /home/oh/frappe-bench/apps/clientside
git add .
echo "🔄 Deploying clientside to EC2..."
cd /home/onehash/frappe-bench/apps/clientside

echo "📦 Stashing any local changes..."
git stash
git pull
bench --site app.onehash.is migrate
echo ${{secrets.EC2_PROD_PW}} | sudo -S supervisorctl restart all
echo ${{secrets.EC2_PROD_PW}} | sudo -S bench setup production oh --yes

echo "⬇️ Pulling latest code from v-15 branch..."
git checkout v-15
git pull upstream v-15

echo "⚙️ Building clientside app..."
bench build --app clientside

echo "🚀 Restarting supervisor services..."
echo ${{secrets.EC2_PW}} | sudo -S supervisorctl restart all