Create LICENSE.txt #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Sierra Leone | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Deploy to Sierra Leone server | |
runs-on: ubuntu-latest | |
env: | |
DB_HOST: ${{ secrets.DB_HOST }} | |
DB_PORT: ${{ secrets.DB_PORT }} | |
DB_USERNAME: ${{ secrets.DB_USERNAME }} | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
DB_DATABASE: ${{ secrets.DB_DATABASE_SL }} | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v1 | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 18.x | |
- name: Install dependencies | |
run: npm install | |
- name: Run Migrations | |
run: npm run build | |
- name: Run Migrations | |
run: npm run migration:run | |
- name: Copy public folder | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
source: "src,node_modules,build,package.json,Dockerfile,docker-compose-sl.yml" | |
target: "/home/ubuntu/apps/coach-backend-sl" | |
- name: executing remote ssh commands using ssh key | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
script: | | |
cd /home/ubuntu/apps/coach-backend-sl | |
sudo docker build -t coach-backend-sl . | |
sudo docker-compose -f docker-compose-sl.yml up -d |