Skip to content

feat: Improve general design of group pages (#1256) #184

feat: Improve general design of group pages (#1256)

feat: Improve general design of group pages (#1256) #184

Workflow file for this run

name: Deploy Server
on:
push:
branches:
- master
paths:
- backend/**
- deployment/**
- frontend/**
- email-templates-generator/**
- .github/workflows/deploy-server.yml
jobs:
changes:
name: Check changes on Front end
runs-on: ubuntu-latest
outputs:
backend: ${{ steps.filter.outputs.backend}}
frontend: ${{ steps.filter.outputs.frontend }}
email-templates: ${{ steps.filter.outputs.email-templates }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
base: ${{ github.ref }}
filters: |
backend:
- 'backend/**'
frontend:
- 'frontend/**'
email-templates:
- 'email-templates-generator/**'
frontend-quality:
name: Test front end quality
needs: changes
if: ${{ needs.changes.outputs.frontend == 'true' }}
uses: ./.github/workflows/quality-frontend.yml
secrets: inherit
backend-quality:
name: Test Back End Quality
needs: changes
if: ${{ needs.changes.outputs.backend == 'true' }}
uses: ./.github/workflows/quality-backend.yml
secrets: inherit
email-templates-quality:
name: Test Email Templates Quality
needs: changes
if: ${{ needs.changes.outputs.email-templates == 'true' }}
uses: ./.github/workflows/quality-email-templates.yml
secrets: inherit
frontend-build:
name: Build front end
needs: frontend-quality
uses: ./.github/workflows/build-frontend.yml
with:
target-directory: "nantralPlatform"
secrets: inherit
email-templates-build:
name: Build email templates
needs: email-templates-quality
uses: ./.github/workflows/build-email-templates.yml
with:
target-directory: "nantralPlatform"
secrets: inherit
backup-database:
name: Create a backup of the database
runs-on: ubuntu-latest
steps:
- name: Backup before deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.INSTANCE_ADDRESS }}
username: "ubuntu"
key: ${{ secrets.SSH_KEY_DEPLOY }}
script: |
set -e
cd nantralPlatform/deployment/scripts
chmod +x db_backup.sh
./db_backup.sh --skip-success-notif
deploy:
name: Deploy on VPS
needs:
[frontend-build, email-templates-build, backend-quality, backup-database]
if: ${{ always() && (needs.frontend-build.result == 'success' || needs.frontend-build.result == 'skipped') && (needs.email-templates-build.result == 'success' || needs.email-templates-build.result == 'skipped') && (needs.backend-quality.result == 'success' || needs.backend-quality.result == 'skipped') && (needs.backup-database.result == 'success') }}
runs-on: ubuntu-latest
steps:
- name: Deploy to the VPS
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.INSTANCE_ADDRESS }}
username: "ubuntu"
key: ${{ secrets.SSH_KEY_DEPLOY }}
script: |
set -e
cd nantralPlatform/deployment
git pull
sudo cp /etc/letsencrypt/live/nantral-platform.fr/privkey.pem /home/ubuntu/nantralPlatform/deployment/certs/key.pem
sudo cp /etc/letsencrypt/live/nantral-platform.fr/fullchain.pem /home/ubuntu/nantralPlatform/deployment/certs/cert.pem
sudo docker-compose -f docker-compose.yml -f docker-compose.prod.yml build --no-cache nginx backend celery celery-beat
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d