Skip to content

Merge pull request #125 from smswithoutborders/dev #104

Merge pull request #125 from smswithoutborders/dev

Merge pull request #125 from smswithoutborders/dev #104

name: Deploy relaysms homepage on Server (staging)
on:
push:
branches:
- staging
jobs:
deploy:
name: Execute Deployment Script on Server
runs-on: ubuntu-latest
environment:
name: staging
url: https://staging.smswithoutborders.com:18500
steps:
- name: Execute Remote SSH Commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
set -e
echo "============================"
echo "πŸš€ Updating repository ..."
echo "============================"
cd ${{ secrets.PROJECT_PATH }}
if ! git pull; then
echo "❌ Error updating repository!"
exit 1
fi
echo "==============================="
echo "βœ… Repository update complete"
echo "==============================="
echo "========================="
echo "πŸš€ Building project ..."
echo "========================="
if ! ${{ secrets.BUILD_CMD }}; then
echo "❌ Error building project!"
exit 1
fi
echo "==========================="
echo "βœ… Project build complete"
echo "==========================="
if ! ${{ secrets.CLEANUP_CMD }}; then
echo "❌ Error cleaning up builds!"
exit 1
fi
echo "============================="
echo "βœ… Cleanup complete"
echo "============================="