Skip to content

Merge pull request #5 from smswithoutborders/staging #1

Merge pull request #5 from smswithoutborders/staging

Merge pull request #5 from smswithoutborders/staging #1

Workflow file for this run

name: πŸš€ Deploy SMSWithoutBorders Visibility Dashboard on Server (production)
on:
push:
branches:
- main
jobs:
deploy:
name: πŸš€ Execute Deployment Script on Server
runs-on: ubuntu-latest
environment:
name: production
url: https://telemetry.smswithoutborders.com
steps:
- name: Checkout Git Repository
uses: actions/checkout@v4
- name: Setup NodeJs
uses: actions/setup-node@v4
with:
node-version: 18
- name: Create .env.local file
run: |
echo "RELIABILITY_URL=${{ vars.RELIABILITY_URL }}" > .env.local
echo "RESILIENCE_URL=${{ vars.RESILIENCE_URL }}" >> .env.local
- name: Install Dependencies
run: yarn install
- name: Build Application
run: yarn build
- name: Securely Copy Artifacts to Server
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: "./build/*"
target: ${{ secrets.BUILD_PATH }}
strip_components: 1
rm: true
- 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 "πŸš€ Deploy Project ..."
echo "============================"
if ! ${{secrets.BUILD_CMD}}; then
echo "❌ Error deploying project!"
exit 1
fi
echo "==============================="
echo "βœ… Deployment complete"
echo "==============================="