Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #109 from smswithoutborders/build/ci
Browse files Browse the repository at this point in the history
build(ci): modify staging workflow to pull and build
  • Loading branch information
PromiseFru authored Jun 12, 2024
2 parents 463ab63 + 794111a commit 1320642
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 18 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/push.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/staging-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Staging Server Build Pipeline

on:
push:
branches:
- staging

jobs:
deploy:
name: Deploy to Staging Server
runs-on: ubuntu-latest
environment:
name: staging
steps:
- name: Execute Remote SSH Commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
set -e
echo "============================"
echo "Updating repository ..."
echo "============================"
cd ${{ secrets.ROOT_PATH }}${{ 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 "========================="
cd ${{ secrets.ROOT_PATH }}
if ! ${{ secrets.BUILD_CMD }}; then
echo "❌ Error building project!"
exit 1
fi
echo "==========================="
echo "✅ Project build complete"
echo "==========================="
echo "============================="
echo "Cleaning up staging builds ..."
echo "============================="
if ! ${{ secrets.CLEANUP_CMD }}; then
echo "❌ Error cleaning up builds!"
exit 1
fi
echo "============================="
echo "✅ Cleanup complete"
echo "============================="

0 comments on commit 1320642

Please sign in to comment.